{
    "cells": [
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "# Hierarchical, Panel and Global Forecasting with `sktime`"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "### Overview of this notebook\n",
                "\n",
                "* introduction - hierarchical time series\n",
                "* hierarchical and panel data format in sktime\n",
                "* automated vectorization of forecasters and transformers\n",
                "* hierarchical reconciliation in sktime\n",
                "* hierarchical forecasting/Global forecasting using summarization/reduction models, \"M5 winner\"\n",
                "* extender guide\n",
                "* introduction - global forecasting\n",
                "* global forecast without exogeneous data\n",
                "* global forecast with exogeneous data\n",
                "* contributor credits"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 1,
            "metadata": {},
            "outputs": [],
            "source": [
                "%%capture\n",
                "import warnings\n",
                "\n",
                "warnings.filterwarnings(\"ignore\")"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "## Hierarchical time series\n",
                "\n",
                "Time series are often present in \"hierarchical\" form, example:\n",
                "\n",
                "<img src=\"./img/hierarchytree.png\" width=\"1200\" alt=\"arrow heads\">\n",
                "\n",
                "Examples include:\n",
                "* Product sales in different categories (e.g. M5 time series competition)\n",
                "* Tourism demand in different regions\n",
                "* Balance sheet structures across cost centers / accounts\n",
                "\n",
                "Many hierarchical time series datasets can be found here:\n",
                "https://forecastingdata.org/\n",
                "(access loader in development)\n",
                "\n",
                "For literature see also:\n",
                "https://otexts.com/fpp2/hierarchical.html\n",
                "\n",
                "A time series can also exhibit multiple independent hierarchies:\n",
                "\n",
                "<img src=\"./img/hierarchytree_grouped.png\" width=\"1200\" alt=\"arrow heads\">"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "\n",
                "### Representation of hierarchical and panel datatypes\n",
                "\n",
                "`sktime` distinguishes as abstract scientific data types for time series (=\"scitypes\"):\n",
                "\n",
                "* `Series` type = one time series (uni or multivariate)\n",
                "* `Panel` type = collection of multiple time series, flat hierarchy\n",
                "* `Hierarchical` type = hierarchical collection of time series, as above\n",
                "\n",
                "Each scitype has multiple mtype representations.\n",
                "\n",
                "For simplicity, we focus only on `pandas.DataFrame` based representations below."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 2,
            "metadata": {},
            "outputs": [],
            "source": [
                "# import to retrieve examples\n",
                "\n",
                "from sktime.datatypes import get_examples"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Individual time series - `Series` scitype, `\"pd.DataFrame\"` mtype\n",
                "\n",
                "In the `\"pd.DataFrame\"` mtype, time series are represented by an in-memory container `obj: pandas.DataFrame` as follows.\n",
                "\n",
                "* structure convention: `obj.index` must be monotonic, and one of `Int64Index`, `RangeIndex`, `DatetimeIndex`, `PeriodIndex`.\n",
                "* variables: columns of `obj` correspond to different variables\n",
                "* variable names: column names `obj.columns`\n",
                "* time points: rows of `obj` correspond to different, distinct time points\n",
                "* time index: `obj.index` is interpreted as a time index.\n",
                "* capabilities: can represent multivariate series; can represent unequally spaced series"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Example of a univariate series in `\"pd.DataFrame\"` representation.\\\n",
                "This series has two variables, named `\"a\"` and `\"b\"`. Both are observed at the same four time points 0, 1, 2, 3."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 3,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th>a</th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th>0</th>\n",
                            "      <td>1.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>4.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>0.5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>3</th>\n",
                            "      <td>-3.0</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "     a\n",
                            "0  1.0\n",
                            "1  4.0\n",
                            "2  0.5\n",
                            "3 -3.0"
                        ]
                    },
                    "execution_count": 3,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "get_examples(mtype=\"pd.DataFrame\")[0]"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Example of a bivariate series in `\"pd.DataFrame\"` representation.\\\n",
                "This series has two variables, named `\"a\"` and `\"b\"`. Both are observed at the same four time points 0, 1, 2, 3."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 4,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th>a</th>\n",
                            "      <th>b</th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th>0</th>\n",
                            "      <td>1.0</td>\n",
                            "      <td>3.000000</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>4.0</td>\n",
                            "      <td>7.000000</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>0.5</td>\n",
                            "      <td>2.000000</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>3</th>\n",
                            "      <td>-3.0</td>\n",
                            "      <td>-0.428571</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "     a         b\n",
                            "0  1.0  3.000000\n",
                            "1  4.0  7.000000\n",
                            "2  0.5  2.000000\n",
                            "3 -3.0 -0.428571"
                        ]
                    },
                    "execution_count": 4,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "get_examples(mtype=\"pd.DataFrame\")[1]"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Panels (= flat collections) of time series - `Panel` scitype, `\"pd-multiindex\"` mtype\n",
                "\n",
                "In the `\"pd-multiindex\"` mtype, time series panels are represented by an in-memory container `obj: pandas.DataFrame` as follows.\n",
                "\n",
                "* structure convention: `obj.index` must be a pair multi-index of type `(RangeIndex, t)`, where `t` is one of `Int64Index`, `RangeIndex`, `DatetimeIndex`, `PeriodIndex` and monotonic.\n",
                "* instances: rows with the same `\"instances\"` index correspond to the same instance; rows with different `\"instances\"` index correspond to different instances.\n",
                "* instance index: the first element of pairs in `obj.index` is interpreted as an instance index. \n",
                "* variables: columns of `obj` correspond to different variables\n",
                "* variable names: column names `obj.columns`\n",
                "* time points: rows of `obj` with the same `\"timepoints\"` index correspond to the same time point; rows of `obj` with different `\"timepoints\"` index correspond to the different time points.\n",
                "* time index: the second element of pairs in `obj.index` is interpreted as a time index. \n",
                "* capabilities: can represent panels of multivariate series; can represent unequally spaced series; can represent panels of unequally supported series; cannot represent panels of series with different sets of variables."
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Example of a panel of multivariate series in `\"pd-multiindex\"` mtype representation.\n",
                "The panel contains three multivariate series, with instance indices 0, 1, 2. All series have two variables with names `\"var_0\"`, `\"var_1\"`. All series are observed at three time points 0, 1, 2."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 5,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "      <th>var_1</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>55</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>42</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                      var_0  var_1\n",
                            "instances timepoints              \n",
                            "0         0               1      4\n",
                            "          1               2      5\n",
                            "          2               3      6\n",
                            "1         0               1      4\n",
                            "          1               2     55\n",
                            "          2               3      6\n",
                            "2         0               1     42\n",
                            "          1               2      5\n",
                            "          2               3      6"
                        ]
                    },
                    "execution_count": 5,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "get_examples(mtype=\"pd-multiindex\")[0]"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Hierarchical time series - `Hierarchical` scitype, `\"pd_multiindex_hier\"` mtype\n",
                "\n",
                "* structure convention: `obj.index` must be a 3 or more level multi-index of type `(RangeIndex, ..., RangeIndex, t)`, where `t` is one of `Int64Index`, `RangeIndex`, `DatetimeIndex`, `PeriodIndex` and monotonic. We call the last index the \"time-like\" index\n",
                "* hierarchy level: rows with the same non-time-like indices correspond to the same hierarchy unit; rows with different non-time-like index combination correspond to different hierarchy unit.\n",
                "* hierarchy: the non-time-like indices in `obj.index` are interpreted as a hierarchy identifying index. \n",
                "* variables: columns of `obj` correspond to different variables\n",
                "* variable names: column names `obj.columns`\n",
                "* time points: rows of `obj` with the same `\"timepoints\"` index correspond to the same time point; rows of `obj` with different `\"timepoints\"` index correspond to the different time points.\n",
                "* time index: the last element of tuples in `obj.index` is interpreted as a time index. \n",
                "* capabilities: can represent hierarchical series; can represent unequally spaced series; can represent unequally supported hierarchical series; cannot represent hierarchical series with different sets of variables."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 6,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "      <th>var_1</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"9\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>55</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>42</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"9\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>55</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "      <td>42</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                    var_0  var_1\n",
                            "foo bar timepoints              \n",
                            "a   0   0               1      4\n",
                            "        1               2      5\n",
                            "        2               3      6\n",
                            "    1   0               1      4\n",
                            "        1               2     55\n",
                            "        2               3      6\n",
                            "    2   0               1     42\n",
                            "        1               2      5\n",
                            "        2               3      6\n",
                            "b   0   0               1      4\n",
                            "        1               2      5\n",
                            "        2               3      6\n",
                            "    1   0               1      4\n",
                            "        1               2     55\n",
                            "        2               3      6\n",
                            "    2   0               1     42\n",
                            "        1               2      5\n",
                            "        2               3      6"
                        ]
                    },
                    "execution_count": 6,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "X = get_examples(mtype=\"pd_multiindex_hier\")[0]\n",
                "X"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 7,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/plain": [
                            "Index([0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2], dtype='int64', name='timepoints')"
                        ]
                    },
                    "execution_count": 7,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "X.index.get_level_values(level=-1)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "\n",
                "### Automated vectorization (casting) of forecasters and transformers\n",
                "\n",
                "Many transformers and forecasters implemented for single series\n",
                "\n",
                "`sktime` automatically vectorizes/\"up-casts\" them to hierarchical data\n",
                "\n",
                "\"apply by individual series/panel in the hierarchical structure\""
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "constructing a hierarchical time series:"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 8,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>c0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>h1</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_0</th>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h1_0</th>\n",
                            "      <th>2000-01-01</th>\n",
                            "      <td>4.890965</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-02</th>\n",
                            "      <td>4.162906</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-03</th>\n",
                            "      <td>2.396068</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-04</th>\n",
                            "      <td>3.617121</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-05</th>\n",
                            "      <td>3.704492</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>...</th>\n",
                            "      <th>...</th>\n",
                            "      <th>...</th>\n",
                            "      <td>...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_1</th>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h1_3</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>2.363052</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.628371</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>1.590486</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>2.495301</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>2.795948</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "<p>96 rows × 1 columns</p>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            c0\n",
                            "h0   h1   time                \n",
                            "h0_0 h1_0 2000-01-01  4.890965\n",
                            "          2000-01-02  4.162906\n",
                            "          2000-01-03  2.396068\n",
                            "          2000-01-04  3.617121\n",
                            "          2000-01-05  3.704492\n",
                            "...                        ...\n",
                            "h0_1 h1_3 2000-01-08  2.363052\n",
                            "          2000-01-09  5.628371\n",
                            "          2000-01-10  1.590486\n",
                            "          2000-01-11  2.495301\n",
                            "          2000-01-12  2.795948\n",
                            "\n",
                            "[96 rows x 1 columns]"
                        ]
                    },
                    "execution_count": 8,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.utils._testing.hierarchical import _make_hierarchical\n",
                "\n",
                "y = _make_hierarchical()\n",
                "y"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "all forecasters and transformers are applicable to this!\\\n",
                "if forecaster implements logic for single series only, \"apply to all hierarchy units\""
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 9,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>c0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>h1</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"8\" valign=\"top\">h0_0</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_0</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>4.011083</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.938423</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_1</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>4.162070</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.837325</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_2</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.569800</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.585248</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_3</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.312264</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.392929</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"8\" valign=\"top\">h0_1</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_0</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.955279</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.975636</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_1</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>4.167355</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.500118</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_2</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.760504</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.763340</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_3</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.755343</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>3.586705</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            c0\n",
                            "h0   h1   time                \n",
                            "h0_0 h1_0 2000-01-13  4.011083\n",
                            "          2000-01-14  3.938423\n",
                            "     h1_1 2000-01-13  4.162070\n",
                            "          2000-01-14  3.837325\n",
                            "     h1_2 2000-01-13  3.569800\n",
                            "          2000-01-14  3.585248\n",
                            "     h1_3 2000-01-13  3.312264\n",
                            "          2000-01-14  3.392929\n",
                            "h0_1 h1_0 2000-01-13  3.955279\n",
                            "          2000-01-14  3.975636\n",
                            "     h1_1 2000-01-13  4.167355\n",
                            "          2000-01-14  3.500118\n",
                            "     h1_2 2000-01-13  3.760504\n",
                            "          2000-01-14  3.763340\n",
                            "     h1_3 2000-01-13  3.755343\n",
                            "          2000-01-14  3.586705"
                        ]
                    },
                    "execution_count": 9,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.forecasting.arima import ARIMA\n",
                "\n",
                "forecaster = ARIMA()\n",
                "\n",
                "y_pred = forecaster.fit(y, fh=[1, 2]).predict()\n",
                "y_pred"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "individual forecasters fitted per hierarchy level are stored in the  `forecasters_` attribute\\\n",
                "this contains a `pandas.DataFrame` in the same format as the hierarchy levels, and fitted forecasters inside\\\n",
                "(for transformers, the attribute is called `transformers_`)"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 10,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>forecasters</th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"4\" valign=\"top\">h0_0</th>\n",
                            "      <th>h1_0</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h1_1</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h1_2</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h1_3</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"4\" valign=\"top\">h0_1</th>\n",
                            "      <th>h1_0</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h1_1</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h1_2</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h1_3</th>\n",
                            "      <td>ARIMA()</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "          forecasters\n",
                            "h0_0 h1_0     ARIMA()\n",
                            "     h1_1     ARIMA()\n",
                            "     h1_2     ARIMA()\n",
                            "     h1_3     ARIMA()\n",
                            "h0_1 h1_0     ARIMA()\n",
                            "     h1_1     ARIMA()\n",
                            "     h1_2     ARIMA()\n",
                            "     h1_3     ARIMA()"
                        ]
                    },
                    "execution_count": 10,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "forecaster.forecasters_"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "to access or inspect individual forecasters, access elements of the `forecasters_` data frame:"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 11,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<table class=\"simpletable\">\n",
                            "<caption>SARIMAX Results</caption>\n",
                            "<tr>\n",
                            "  <th>Dep. Variable:</th>           <td>y</td>        <th>  No. Observations:  </th>   <td>12</td>   \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Model:</th>           <td>SARIMAX(1, 0, 0)</td> <th>  Log Likelihood     </th> <td>-14.307</td>\n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Date:</th>            <td>Sun, 16 Feb 2025</td> <th>  AIC                </th> <td>34.614</td> \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Time:</th>                <td>17:32:07</td>     <th>  BIC                </th> <td>36.068</td> \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Sample:</th>                  <td>0</td>        <th>  HQIC               </th> <td>34.075</td> \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th></th>                       <td> - 12</td>      <th>                     </th>    <td> </td>   \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Covariance Type:</th>        <td>opg</td>       <th>                     </th>    <td> </td>   \n",
                            "</tr>\n",
                            "</table>\n",
                            "<table class=\"simpletable\">\n",
                            "<tr>\n",
                            "      <td></td>         <th>coef</th>     <th>std err</th>      <th>z</th>      <th>P>|z|</th>  <th>[0.025</th>    <th>0.975]</th>  \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>intercept</th> <td>    2.0438</td> <td>    1.492</td> <td>    1.369</td> <td> 0.171</td> <td>   -0.881</td> <td>    4.969</td>\n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>ar.L1</th>     <td>    0.4724</td> <td>    0.385</td> <td>    1.228</td> <td> 0.220</td> <td>   -0.282</td> <td>    1.226</td>\n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>sigma2</th>    <td>    0.6222</td> <td>    0.348</td> <td>    1.786</td> <td> 0.074</td> <td>   -0.060</td> <td>    1.305</td>\n",
                            "</tr>\n",
                            "</table>\n",
                            "<table class=\"simpletable\">\n",
                            "<tr>\n",
                            "  <th>Ljung-Box (L1) (Q):</th>     <td>0.37</td> <th>  Jarque-Bera (JB):  </th> <td>0.90</td> \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Prob(Q):</th>                <td>0.54</td> <th>  Prob(JB):          </th> <td>0.64</td> \n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Heteroskedasticity (H):</th> <td>0.41</td> <th>  Skew:              </th> <td>-0.57</td>\n",
                            "</tr>\n",
                            "<tr>\n",
                            "  <th>Prob(H) (two-sided):</th>    <td>0.40</td> <th>  Kurtosis:          </th> <td>2.30</td> \n",
                            "</tr>\n",
                            "</table><br/><br/>Warnings:<br/>[1] Covariance matrix calculated using the outer product of gradients (complex-step)."
                        ],
                        "text/latex": [
                            "\\begin{center}\n",
                            "\\begin{tabular}{lclc}\n",
                            "\\toprule\n",
                            "\\textbf{Dep. Variable:}          &        y         & \\textbf{  No. Observations:  } &     12      \\\\\n",
                            "\\textbf{Model:}                  & SARIMAX(1, 0, 0) & \\textbf{  Log Likelihood     } &  -14.307    \\\\\n",
                            "\\textbf{Date:}                   & Sun, 16 Feb 2025 & \\textbf{  AIC                } &   34.614    \\\\\n",
                            "\\textbf{Time:}                   &     17:32:07     & \\textbf{  BIC                } &   36.068    \\\\\n",
                            "\\textbf{Sample:}                 &        0         & \\textbf{  HQIC               } &   34.075    \\\\\n",
                            "\\textbf{}                        &       - 12       & \\textbf{                     } &             \\\\\n",
                            "\\textbf{Covariance Type:}        &       opg        & \\textbf{                     } &             \\\\\n",
                            "\\bottomrule\n",
                            "\\end{tabular}\n",
                            "\\begin{tabular}{lcccccc}\n",
                            "                   & \\textbf{coef} & \\textbf{std err} & \\textbf{z} & \\textbf{P$> |$z$|$} & \\textbf{[0.025} & \\textbf{0.975]}  \\\\\n",
                            "\\midrule\n",
                            "\\textbf{intercept} &       2.0438  &        1.492     &     1.369  &         0.171        &       -0.881    &        4.969     \\\\\n",
                            "\\textbf{ar.L1}     &       0.4724  &        0.385     &     1.228  &         0.220        &       -0.282    &        1.226     \\\\\n",
                            "\\textbf{sigma2}    &       0.6222  &        0.348     &     1.786  &         0.074        &       -0.060    &        1.305     \\\\\n",
                            "\\bottomrule\n",
                            "\\end{tabular}\n",
                            "\\begin{tabular}{lclc}\n",
                            "\\textbf{Ljung-Box (L1) (Q):}     & 0.37 & \\textbf{  Jarque-Bera (JB):  } &  0.90  \\\\\n",
                            "\\textbf{Prob(Q):}                & 0.54 & \\textbf{  Prob(JB):          } &  0.64  \\\\\n",
                            "\\textbf{Heteroskedasticity (H):} & 0.41 & \\textbf{  Skew:              } & -0.57  \\\\\n",
                            "\\textbf{Prob(H) (two-sided):}    & 0.40 & \\textbf{  Kurtosis:          } &  2.30  \\\\\n",
                            "\\bottomrule\n",
                            "\\end{tabular}\n",
                            "%\\caption{SARIMAX Results}\n",
                            "\\end{center}\n",
                            "\n",
                            "Warnings: \\newline\n",
                            " [1] Covariance matrix calculated using the outer product of gradients (complex-step)."
                        ],
                        "text/plain": [
                            "<class 'statsmodels.iolib.summary.Summary'>\n",
                            "\"\"\"\n",
                            "                               SARIMAX Results                                \n",
                            "==============================================================================\n",
                            "Dep. Variable:                      y   No. Observations:                   12\n",
                            "Model:               SARIMAX(1, 0, 0)   Log Likelihood                 -14.307\n",
                            "Date:                Sun, 16 Feb 2025   AIC                             34.614\n",
                            "Time:                        17:32:07   BIC                             36.068\n",
                            "Sample:                             0   HQIC                            34.075\n",
                            "                                 - 12                                         \n",
                            "Covariance Type:                  opg                                         \n",
                            "==============================================================================\n",
                            "                 coef    std err          z      P>|z|      [0.025      0.975]\n",
                            "------------------------------------------------------------------------------\n",
                            "intercept      2.0438      1.492      1.369      0.171      -0.881       4.969\n",
                            "ar.L1          0.4724      0.385      1.228      0.220      -0.282       1.226\n",
                            "sigma2         0.6222      0.348      1.786      0.074      -0.060       1.305\n",
                            "===================================================================================\n",
                            "Ljung-Box (L1) (Q):                   0.37   Jarque-Bera (JB):                 0.90\n",
                            "Prob(Q):                              0.54   Prob(JB):                         0.64\n",
                            "Heteroskedasticity (H):               0.41   Skew:                            -0.57\n",
                            "Prob(H) (two-sided):                  0.40   Kurtosis:                         2.30\n",
                            "===================================================================================\n",
                            "\n",
                            "Warnings:\n",
                            "[1] Covariance matrix calculated using the outer product of gradients (complex-step).\n",
                            "\"\"\""
                        ]
                    },
                    "execution_count": 11,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "forecaster.forecasters_.iloc[0, 0].summary()"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "auto-vectorization is also performed for probabilistic forecasts (see notebook 2):"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 12,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead tr th {\n",
                            "        text-align: left;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead tr:last-of-type th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th colspan=\"2\" halign=\"left\">c0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th colspan=\"2\" halign=\"left\">0.9</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>lower</th>\n",
                            "      <th>upper</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>h1</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"8\" valign=\"top\">h0_0</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_0</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>2.713605</td>\n",
                            "      <td>5.308561</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>2.503483</td>\n",
                            "      <td>5.373363</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_1</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>2.325116</td>\n",
                            "      <td>5.999025</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>1.967973</td>\n",
                            "      <td>5.706677</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_2</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>2.265449</td>\n",
                            "      <td>4.874152</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>2.183641</td>\n",
                            "      <td>4.986854</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_3</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>1.561885</td>\n",
                            "      <td>5.062643</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>1.615546</td>\n",
                            "      <td>5.170311</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"8\" valign=\"top\">h0_1</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_0</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>2.435657</td>\n",
                            "      <td>5.474901</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>2.408696</td>\n",
                            "      <td>5.542577</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_1</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.170080</td>\n",
                            "      <td>5.164631</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>2.443799</td>\n",
                            "      <td>4.556436</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_2</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>2.574963</td>\n",
                            "      <td>4.946045</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>2.577726</td>\n",
                            "      <td>4.948955</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">h1_3</th>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>1.766964</td>\n",
                            "      <td>5.743722</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-14</th>\n",
                            "      <td>1.567843</td>\n",
                            "      <td>5.605568</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            c0          \n",
                            "                           0.9          \n",
                            "                         lower     upper\n",
                            "h0   h1   time                          \n",
                            "h0_0 h1_0 2000-01-13  2.713605  5.308561\n",
                            "          2000-01-14  2.503483  5.373363\n",
                            "     h1_1 2000-01-13  2.325116  5.999025\n",
                            "          2000-01-14  1.967973  5.706677\n",
                            "     h1_2 2000-01-13  2.265449  4.874152\n",
                            "          2000-01-14  2.183641  4.986854\n",
                            "     h1_3 2000-01-13  1.561885  5.062643\n",
                            "          2000-01-14  1.615546  5.170311\n",
                            "h0_1 h1_0 2000-01-13  2.435657  5.474901\n",
                            "          2000-01-14  2.408696  5.542577\n",
                            "     h1_1 2000-01-13  3.170080  5.164631\n",
                            "          2000-01-14  2.443799  4.556436\n",
                            "     h1_2 2000-01-13  2.574963  4.946045\n",
                            "          2000-01-14  2.577726  4.948955\n",
                            "     h1_3 2000-01-13  1.766964  5.743722\n",
                            "          2000-01-14  1.567843  5.605568"
                        ]
                    },
                    "execution_count": 12,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "forecaster.predict_interval()"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "which level a forecaster/natively implements and when vectorization occurs is determined by the \"inner mtype\" attributes.\n",
                "\n",
                "For forecasters, inspect `y_inner_mtype`, this is a list of internally supported machine types:"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 13,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/plain": [
                            "'pd.Series'"
                        ]
                    },
                    "execution_count": 13,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "forecaster.get_tag(\"y_inner_mtype\")"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "ARIMA supports only one `Series` level mtype.\n",
                "For a register of all mtype codes and their corresponding scitype (series, panel or hierarchical),\\\n",
                "see `sktime.datatypes.MTYPE_REGISTER` (convert to `pandas.DataFrame` for pretty-printing)"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 14,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th>0</th>\n",
                            "      <th>1</th>\n",
                            "      <th>2</th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th>0</th>\n",
                            "      <td>pd.Series</td>\n",
                            "      <td>Series</td>\n",
                            "      <td>pd.Series representation of a univariate series</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>pd.DataFrame</td>\n",
                            "      <td>Series</td>\n",
                            "      <td>pd.DataFrame representation of a uni- or multi...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>np.ndarray</td>\n",
                            "      <td>Series</td>\n",
                            "      <td>2D numpy.ndarray with rows=samples, cols=varia...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>3</th>\n",
                            "      <td>xr.DataArray</td>\n",
                            "      <td>Series</td>\n",
                            "      <td>xr.DataArray representation of a uni- or multi...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>dask_series</td>\n",
                            "      <td>Series</td>\n",
                            "      <td>xdas representation of a uni- or multivariate ...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>5</th>\n",
                            "      <td>pl.DataFrame</td>\n",
                            "      <td>Series</td>\n",
                            "      <td>pl.DataFrame representation of a uni- or multi...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>6</th>\n",
                            "      <td>gluonts_ListDataset_series</td>\n",
                            "      <td>Series</td>\n",
                            "      <td>gluonTS representation of univariate and multi...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>7</th>\n",
                            "      <td>nested_univ</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>pd.DataFrame with one column per variable, pd....</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>8</th>\n",
                            "      <td>numpy3D</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>3D np.array of format (n_instances, n_columns,...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>9</th>\n",
                            "      <td>numpyflat</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>WARNING: only for internal use, not a fully su...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>10</th>\n",
                            "      <td>pd-multiindex</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>pd.DataFrame with multi-index (instances, time...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>11</th>\n",
                            "      <td>pd-wide</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>pd.DataFrame in wide format, cols = (instance*...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>12</th>\n",
                            "      <td>pd-long</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>pd.DataFrame in long format, cols = (index, ti...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>13</th>\n",
                            "      <td>df-list</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>list of pd.DataFrame</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>14</th>\n",
                            "      <td>gluonts_ListDataset_panel</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>gluonTS representation of univariate and multi...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>15</th>\n",
                            "      <td>gluonts_PandasDataset_panel</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>gluonTS representation of a pandas DataFrame</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>16</th>\n",
                            "      <td>polars_panel</td>\n",
                            "      <td>Panel</td>\n",
                            "      <td>Polars frame representing a Panel, with one in...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>17</th>\n",
                            "      <td>pd_multiindex_hier</td>\n",
                            "      <td>Hierarchical</td>\n",
                            "      <td>pd.DataFrame with MultiIndex</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>18</th>\n",
                            "      <td>dask_hierarchical</td>\n",
                            "      <td>Hierarchical</td>\n",
                            "      <td>dask frame with multiple hierarchical indices,...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>19</th>\n",
                            "      <td>polars_hierarchical</td>\n",
                            "      <td>Hierarchical</td>\n",
                            "      <td>polars frame with multiple hierarchical indice...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>20</th>\n",
                            "      <td>alignment</td>\n",
                            "      <td>Alignment</td>\n",
                            "      <td>pd.DataFrame in alignment format, values are i...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>21</th>\n",
                            "      <td>alignment_loc</td>\n",
                            "      <td>Alignment</td>\n",
                            "      <td>pd.DataFrame in alignment format, values are l...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>22</th>\n",
                            "      <td>pd_DataFrame_Table</td>\n",
                            "      <td>Table</td>\n",
                            "      <td>pd.DataFrame representation of a data table</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>23</th>\n",
                            "      <td>numpy1D</td>\n",
                            "      <td>Table</td>\n",
                            "      <td>1D np.narray representation of a univariate da...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>24</th>\n",
                            "      <td>numpy2D</td>\n",
                            "      <td>Table</td>\n",
                            "      <td>2D np.narray representation of a multivariate ...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>25</th>\n",
                            "      <td>pd_Series_Table</td>\n",
                            "      <td>Table</td>\n",
                            "      <td>pd.Series representation of a univariate data ...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>26</th>\n",
                            "      <td>list_of_dict</td>\n",
                            "      <td>Table</td>\n",
                            "      <td>list of dictionaries with primitive entries</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>27</th>\n",
                            "      <td>polars_eager_table</td>\n",
                            "      <td>Table</td>\n",
                            "      <td>polars.DataFrame representation of a data table</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>28</th>\n",
                            "      <td>polars_lazy_table</td>\n",
                            "      <td>Table</td>\n",
                            "      <td>polars.LazyFrame representation of a data table</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>29</th>\n",
                            "      <td>pred_interval</td>\n",
                            "      <td>Proba</td>\n",
                            "      <td>predictive intervals</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>30</th>\n",
                            "      <td>pred_quantiles</td>\n",
                            "      <td>Proba</td>\n",
                            "      <td>quantile predictions</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>31</th>\n",
                            "      <td>pred_var</td>\n",
                            "      <td>Proba</td>\n",
                            "      <td>variance predictions</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                              0             1  \\\n",
                            "0                     pd.Series        Series   \n",
                            "1                  pd.DataFrame        Series   \n",
                            "2                    np.ndarray        Series   \n",
                            "3                  xr.DataArray        Series   \n",
                            "4                   dask_series        Series   \n",
                            "5                  pl.DataFrame        Series   \n",
                            "6    gluonts_ListDataset_series        Series   \n",
                            "7                   nested_univ         Panel   \n",
                            "8                       numpy3D         Panel   \n",
                            "9                     numpyflat         Panel   \n",
                            "10                pd-multiindex         Panel   \n",
                            "11                      pd-wide         Panel   \n",
                            "12                      pd-long         Panel   \n",
                            "13                      df-list         Panel   \n",
                            "14    gluonts_ListDataset_panel         Panel   \n",
                            "15  gluonts_PandasDataset_panel         Panel   \n",
                            "16                 polars_panel         Panel   \n",
                            "17           pd_multiindex_hier  Hierarchical   \n",
                            "18            dask_hierarchical  Hierarchical   \n",
                            "19          polars_hierarchical  Hierarchical   \n",
                            "20                    alignment     Alignment   \n",
                            "21                alignment_loc     Alignment   \n",
                            "22           pd_DataFrame_Table         Table   \n",
                            "23                      numpy1D         Table   \n",
                            "24                      numpy2D         Table   \n",
                            "25              pd_Series_Table         Table   \n",
                            "26                 list_of_dict         Table   \n",
                            "27           polars_eager_table         Table   \n",
                            "28            polars_lazy_table         Table   \n",
                            "29                pred_interval         Proba   \n",
                            "30               pred_quantiles         Proba   \n",
                            "31                     pred_var         Proba   \n",
                            "\n",
                            "                                                    2  \n",
                            "0     pd.Series representation of a univariate series  \n",
                            "1   pd.DataFrame representation of a uni- or multi...  \n",
                            "2   2D numpy.ndarray with rows=samples, cols=varia...  \n",
                            "3   xr.DataArray representation of a uni- or multi...  \n",
                            "4   xdas representation of a uni- or multivariate ...  \n",
                            "5   pl.DataFrame representation of a uni- or multi...  \n",
                            "6   gluonTS representation of univariate and multi...  \n",
                            "7   pd.DataFrame with one column per variable, pd....  \n",
                            "8   3D np.array of format (n_instances, n_columns,...  \n",
                            "9   WARNING: only for internal use, not a fully su...  \n",
                            "10  pd.DataFrame with multi-index (instances, time...  \n",
                            "11  pd.DataFrame in wide format, cols = (instance*...  \n",
                            "12  pd.DataFrame in long format, cols = (index, ti...  \n",
                            "13                               list of pd.DataFrame  \n",
                            "14  gluonTS representation of univariate and multi...  \n",
                            "15       gluonTS representation of a pandas DataFrame  \n",
                            "16  Polars frame representing a Panel, with one in...  \n",
                            "17                       pd.DataFrame with MultiIndex  \n",
                            "18  dask frame with multiple hierarchical indices,...  \n",
                            "19  polars frame with multiple hierarchical indice...  \n",
                            "20  pd.DataFrame in alignment format, values are i...  \n",
                            "21  pd.DataFrame in alignment format, values are l...  \n",
                            "22        pd.DataFrame representation of a data table  \n",
                            "23  1D np.narray representation of a univariate da...  \n",
                            "24  2D np.narray representation of a multivariate ...  \n",
                            "25  pd.Series representation of a univariate data ...  \n",
                            "26        list of dictionaries with primitive entries  \n",
                            "27    polars.DataFrame representation of a data table  \n",
                            "28    polars.LazyFrame representation of a data table  \n",
                            "29                               predictive intervals  \n",
                            "30                               quantile predictions  \n",
                            "31                               variance predictions  "
                        ]
                    },
                    "execution_count": 14,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "import pandas as pd\n",
                "\n",
                "from sktime.datatypes import MTYPE_REGISTER\n",
                "\n",
                "pd.DataFrame(MTYPE_REGISTER)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "roadmap items:\n",
                "\n",
                "* interfacing and implementing common methods with native hierarchical support\n",
                "    * ARIMA using hierarchy factors, GEE, mixed effects\n",
                "* wrappers for \"using hierarchy levels\" as covariates or exogeneous features\n",
                "* full vectorization over variables to render univariate forecasters multivariate\n",
                "\n",
                "contributions are appreciated!"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "\n",
                "### Hierarchical reconciliation\n",
                "\n",
                "#### Why do we need hierarchical reconciliation\n",
                "\n",
                "forecast reconciliation = ensuring that linear hierarchy dependencies are met,\\\n",
                "e.g., \"sum of individual shop sales in Berlin must equal sum of total sales in Berlin\"\\\n",
                "requires hierarchical (or panel) data, usually involves totals. \n",
                "\n",
                "**Bottom-up reconciliation** works by generating forecasts only at the lowest level and then aggregating them to obtain totals at higher levels.\n",
                "\n",
                "- Arguably the simplest algorithm for reconciling forecasts across hierarchies.\n",
                "- **Advantages**: Easy to implement and captures the peculiarities of lower levels in the hierarchy.\n",
                "- **Disadvantages**: Lower levels tend to exhibit excess volatility, which gets aggregated upward, often leading to less accurate top-level forecasts.\n",
                "\n",
                "**Top-down reconciliation** works by first generating top-level forecasts and then distributing them across lower levels based on predefined proportions. There are two primary approaches:\n",
                "\n",
                "- **Forecast proportions (`td_fcst`)**: Keep the total forecast unchanged, forecast the non-total levels separately, and then transform these forecasts into proportions of the total. Finally, multiply these proportions by the total forecast to obtain forecasts for all levels.\n",
                "  - **Advantages**: If the top level is easy to forecast, this method can improve overall accuracy. Standard forecasting models can be applied at non-total levels since they remain in the original domain.\n",
                "  - **Disadvantages**: Heavily dependent on the accuracy of the top-level forecast.\n",
                "\n",
                "- **Historical proportions (`td_share`)**: Forecast the top level, convert non-total series into shares relative to their parent, and then multiply these shares by the top-level forecast.\n",
                "  - **Advantages**: Easy to implement, stable at the top level, and shares may be easier to forecast than the original series.\n",
                "  - **Disadvantages**: Susceptible to errors in both the top-level forecast and the stability of the historical shares.\n",
                "\n",
                "**Optimal forecast reconciliation** generates forecasts at all levels and adjusts them in a way that minimizes forecast errors.\n",
                "\n",
                "- **Advantages**: If the error covariance matrix is correctly specified, this method can yield the most accurate forecasts.\n",
                "- **Disadvantages**: When dealing with a large number of time series, estimating the covariance matrix can be challenging.\n",
                "\n",
                "The optimal forecast, in the original implementation, may not respect non-negative constraints. Fortunately, sktime includes an implementation of the optimal forecast reconciliation algorithm that respects these constraints.\n"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`sktime` provides functionality for reconciliation:\n",
                "\n",
                "* data container convention for node-wise aggregates\n",
                "* functionality to compute node-wise aggregates - `Aggregator`\n",
                "    * can be used for bottom-up reconciliation\n",
                "* transformer implementing reconciliation logic - `BottomUpReconciler()`, `TopdownReconciler(\"td_fcst\")`, `TopdownReconciler(\"td_share\")`, `OptimalReconciler(\"ols\")`\n",
                "    * these transformations are meant to be used in a pipeline, by preprocessing the data before fitting a forecaster and postprocessing the forecasts\n",
                "* `Reconcile` - the previous version of reconciliation in sktime, that is meant to reconcile forecasts, without a pipeline, when possible.\n"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### The node-wise aggregate data format"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`sktime` uses a special case of the `pd_multiindex_hier` format to store node-wise aggregates:\n",
                "\n",
                "* a `__total` index element in an instance (non-time-like) level indicates summation over all instances below that level\n",
                "* the `__total` index element is reserved and cannot be used for anything else\n",
                "* entries below a `__total` index element are sums of entries over all other instances in the same levels where a `__total` element is found"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### The aggregation transformer\n",
                "\n",
                "The node-wise aggregated format can be obtained by applying the `Aggregator` transformer.\n",
                "\n",
                "In a pipeline with non-aggregate dinput, this allows making forecasts by totals."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 15,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"9\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"9\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                    var_0\n",
                            "foo bar timepoints       \n",
                            "a   0   0               1\n",
                            "        1               2\n",
                            "        2               3\n",
                            "    1   0               1\n",
                            "        1               2\n",
                            "        2               3\n",
                            "    2   0               1\n",
                            "        1               2\n",
                            "        2               3\n",
                            "b   0   0               1\n",
                            "        1               2\n",
                            "        2               3\n",
                            "    1   0               1\n",
                            "        1               2\n",
                            "        2               3\n",
                            "    2   0               1\n",
                            "        1               2\n",
                            "        2               3"
                        ]
                    },
                    "execution_count": 15,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.datatypes import get_examples\n",
                "\n",
                "y_hier = get_examples(\"pd_multiindex_hier\")[1]\n",
                "y_hier"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 16,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th>0</th>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>12</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>18</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"12\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th>0</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>9</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"12\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th>0</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>9</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            var_0\n",
                            "foo     bar     timepoints       \n",
                            "__total __total 0               6\n",
                            "                1              12\n",
                            "                2              18\n",
                            "a       0       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        1       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        2       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        __total 0               3\n",
                            "                1               6\n",
                            "                2               9\n",
                            "b       0       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        1       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        2       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        __total 0               3\n",
                            "                1               6\n",
                            "                2               9"
                        ]
                    },
                    "execution_count": 16,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.transformations.hierarchical.aggregate import Aggregator\n",
                "\n",
                "Aggregator().fit_transform(y_hier)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "If used at the start of a pipeline, forecasts are made for node `__total`-s as well as individual instances.\n",
                "\n",
                "Note: in general, this does not result in a reconciled forecast, i.e., forecast totals will not add up."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 17,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"6\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">0</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">2</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"6\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">0</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">2</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                    var_0\n",
                            "foo bar timepoints       \n",
                            "a   0   3             3.0\n",
                            "        4             3.0\n",
                            "    1   3             3.0\n",
                            "        4             3.0\n",
                            "    2   3             3.0\n",
                            "        4             3.0\n",
                            "b   0   3             3.0\n",
                            "        4             3.0\n",
                            "    1   3             3.0\n",
                            "        4             3.0\n",
                            "    2   3             3.0\n",
                            "        4             3.0"
                        ]
                    },
                    "execution_count": 17,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.forecasting.naive import NaiveForecaster\n",
                "\n",
                "pipeline_to_forecast_totals = Aggregator() * NaiveForecaster()\n",
                "\n",
                "pipeline_to_forecast_totals.fit(y_hier, fh=[1, 2])\n",
                "pipeline_to_forecast_totals.predict()"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Reconciling with transformations\n",
                "\n",
                "To make forecasts add up, we can use a reconciliation method, such as `BottomUpReconciler`, `TopdownReconciler`, `MiddleOutReconciler`, `OptimalReconciler` or `NonNegativeOptimalReconciler`."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 28,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<style>#sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c {\n",
                            "    /* Definition of color scheme common for light and dark mode */\n",
                            "    --sklearn-color-text: black;\n",
                            "    --sklearn-color-line: gray;\n",
                            "    /* Definition of color scheme for objects */\n",
                            "    --sklearn-color-level-0: #fff5e6;\n",
                            "    --sklearn-color-level-1: #f6e4d2;\n",
                            "    --sklearn-color-level-2: #ffe0b3;\n",
                            "    --sklearn-color-level-3: chocolate;\n",
                            "\n",
                            "    /* Specific color for light theme */\n",
                            "    --sklearn-color-text-on-default-background: var(--theme-code-foreground, var(--jp-content-font-color1, black));\n",
                            "    --sklearn-color-background: var(--theme-background, var(--jp-layout-color0, white));\n",
                            "    --sklearn-color-border-box: var(--theme-code-foreground, var(--jp-content-font-color1, black));\n",
                            "    --sklearn-color-icon: #696969;\n",
                            "\n",
                            "    @media (prefers-color-scheme: dark) {\n",
                            "      /* Redefinition of color scheme for dark theme */\n",
                            "      --sklearn-color-text-on-default-background: var(--theme-code-foreground, var(--jp-content-font-color1, white));\n",
                            "      --sklearn-color-background: var(--theme-background, var(--jp-layout-color0, #111));\n",
                            "      --sklearn-color-border-box: var(--theme-code-foreground, var(--jp-content-font-color1, white));\n",
                            "      --sklearn-color-icon: #878787;\n",
                            "    }\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c {\n",
                            "    color: var(--sklearn-color-text);\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c pre {\n",
                            "    padding: 0;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c input.sk-hidden--visually {\n",
                            "    border: 0;\n",
                            "    clip: rect(1px 1px 1px 1px);\n",
                            "    clip: rect(1px, 1px, 1px, 1px);\n",
                            "    height: 1px;\n",
                            "    margin: -1px;\n",
                            "    overflow: hidden;\n",
                            "    padding: 0;\n",
                            "    position: absolute;\n",
                            "    width: 1px;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-dashed-wrapped {\n",
                            "    border: 1px dashed var(--sklearn-color-line);\n",
                            "    margin: 0 0.4em 0.5em 0.4em;\n",
                            "    box-sizing: border-box;\n",
                            "    padding-bottom: 0.4em;\n",
                            "    background-color: var(--sklearn-color-background);\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-container {\n",
                            "    /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
                            "       but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
                            "       so we also need the `!important` here to be able to override the\n",
                            "       default hidden behavior on the sphinx rendered scikit-learn.org.\n",
                            "       See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
                            "    display: inline-block !important;\n",
                            "    position: relative;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-text-repr-fallback {\n",
                            "    display: none;\n",
                            "  }\n",
                            "\n",
                            "  div.sk-parallel-item,\n",
                            "  div.sk-serial,\n",
                            "  div.sk-item {\n",
                            "    /* draw centered vertical line to link estimators */\n",
                            "    background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
                            "    background-size: 2px 100%;\n",
                            "    background-repeat: no-repeat;\n",
                            "    background-position: center center;\n",
                            "  }\n",
                            "\n",
                            "  /* Parallel-specific style estimator block */\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-parallel-item::after {\n",
                            "    content: \"\";\n",
                            "    width: 100%;\n",
                            "    border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
                            "    flex-grow: 1;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-parallel {\n",
                            "    display: flex;\n",
                            "    align-items: stretch;\n",
                            "    justify-content: center;\n",
                            "    background-color: var(--sklearn-color-background);\n",
                            "    position: relative;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-parallel-item {\n",
                            "    display: flex;\n",
                            "    flex-direction: column;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-parallel-item:first-child::after {\n",
                            "    align-self: flex-end;\n",
                            "    width: 50%;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-parallel-item:last-child::after {\n",
                            "    align-self: flex-start;\n",
                            "    width: 50%;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-parallel-item:only-child::after {\n",
                            "    width: 0;\n",
                            "  }\n",
                            "\n",
                            "  /* Serial-specific style estimator block */\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-serial {\n",
                            "    display: flex;\n",
                            "    flex-direction: column;\n",
                            "    align-items: center;\n",
                            "    background-color: var(--sklearn-color-background);\n",
                            "    padding-right: 1em;\n",
                            "    padding-left: 1em;\n",
                            "  }\n",
                            "\n",
                            "\n",
                            "  /* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
                            "  clickable and can be expanded/collapsed.\n",
                            "  - Pipeline and ColumnTransformer use this feature and define the default style\n",
                            "  - Estimators will overwrite some part of the style using the `sk-estimator` class\n",
                            "  */\n",
                            "\n",
                            "  /* Pipeline and ColumnTransformer style (default) */\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-toggleable {\n",
                            "    /* Default theme specific background. It is overwritten whether we have a\n",
                            "    specific estimator or a Pipeline/ColumnTransformer */\n",
                            "    background-color: var(--sklearn-color-background);\n",
                            "  }\n",
                            "\n",
                            "  /* Toggleable label */\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c label.sk-toggleable__label {\n",
                            "    cursor: pointer;\n",
                            "    display: block;\n",
                            "    width: 100%;\n",
                            "    margin-bottom: 0;\n",
                            "    padding: 0.5em;\n",
                            "    box-sizing: border-box;\n",
                            "    text-align: center;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c label.sk-toggleable__label-arrow:before {\n",
                            "    /* Arrow on the left of the label */\n",
                            "    content: \"▸\";\n",
                            "    float: left;\n",
                            "    margin-right: 0.25em;\n",
                            "    color: var(--sklearn-color-icon);\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c label.sk-toggleable__label-arrow:hover:before {\n",
                            "    color: var(--sklearn-color-text);\n",
                            "  }\n",
                            "\n",
                            "  /* Toggleable content - dropdown */\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-toggleable__content {\n",
                            "    max-height: 0;\n",
                            "    max-width: 0;\n",
                            "    overflow: hidden;\n",
                            "    text-align: left;\n",
                            "    background-color: var(--sklearn-color-level-0);\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-toggleable__content pre {\n",
                            "    margin: 0.2em;\n",
                            "    border-radius: 0.25em;\n",
                            "    color: var(--sklearn-color-text);\n",
                            "    background-color: var(--sklearn-color-level-0);\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
                            "    /* Expand drop-down */\n",
                            "    max-height: 200px;\n",
                            "    max-width: 100%;\n",
                            "    overflow: auto;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
                            "    content: \"▾\";\n",
                            "  }\n",
                            "\n",
                            "  /* Pipeline/ColumnTransformer-specific style */\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
                            "    color: var(--sklearn-color-text);\n",
                            "    background-color: var(--sklearn-color-level-2);\n",
                            "  }\n",
                            "\n",
                            "  /* Estimator-specific style */\n",
                            "\n",
                            "  /* Colorize estimator box */\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
                            "    /* unfitted */\n",
                            "    background-color: var(--sklearn-color-level-2);\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-label label.sk-toggleable__label,\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-label label {\n",
                            "    /* The background is the default theme color */\n",
                            "    color: var(--sklearn-color-text-on-default-background);\n",
                            "  }\n",
                            "\n",
                            "  /* On hover, darken the color of the background */\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-label:hover label.sk-toggleable__label {\n",
                            "    color: var(--sklearn-color-text);\n",
                            "    background-color: var(--sklearn-color-level-2);\n",
                            "  }\n",
                            "\n",
                            "  /* Estimator label */\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-label label {\n",
                            "    font-family: monospace;\n",
                            "    font-weight: bold;\n",
                            "    display: inline-block;\n",
                            "    line-height: 1.2em;\n",
                            "  }\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-label-container {\n",
                            "    text-align: center;\n",
                            "  }\n",
                            "\n",
                            "  /* Estimator-specific */\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-estimator {\n",
                            "    font-family: monospace;\n",
                            "    border: 1px dotted var(--sklearn-color-border-box);\n",
                            "    border-radius: 0.25em;\n",
                            "    box-sizing: border-box;\n",
                            "    margin-bottom: 0.5em;\n",
                            "    background-color: var(--sklearn-color-level-0);\n",
                            "  }\n",
                            "\n",
                            "  /* on hover */\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c div.sk-estimator:hover {\n",
                            "    background-color: var(--sklearn-color-level-2);\n",
                            "  }\n",
                            "\n",
                            "  /* Specification for estimator info */\n",
                            "\n",
                            "  .sk-estimator-doc-link,\n",
                            "  a:link.sk-estimator-doc-link,\n",
                            "  a:visited.sk-estimator-doc-link {\n",
                            "    float: right;\n",
                            "    font-size: smaller;\n",
                            "    line-height: 1em;\n",
                            "    font-family: monospace;\n",
                            "    background-color: var(--sklearn-color-background);\n",
                            "    border-radius: 1em;\n",
                            "    height: 1em;\n",
                            "    width: 1em;\n",
                            "    text-decoration: none !important;\n",
                            "    margin-left: 1ex;\n",
                            "    border: var(--sklearn-color-level-1) 1pt solid;\n",
                            "    color: var(--sklearn-color-level-1);\n",
                            "  }\n",
                            "\n",
                            "  /* On hover */\n",
                            "  div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
                            "  .sk-estimator-doc-link:hover,\n",
                            "  div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
                            "  .sk-estimator-doc-link:hover {\n",
                            "    background-color: var(--sklearn-color-level-3);\n",
                            "    color: var(--sklearn-color-background);\n",
                            "    text-decoration: none;\n",
                            "  }\n",
                            "\n",
                            "  /* Span, style for the box shown on hovering the info icon */\n",
                            "  .sk-estimator-doc-link span {\n",
                            "    display: none;\n",
                            "    z-index: 9999;\n",
                            "    position: relative;\n",
                            "    font-weight: normal;\n",
                            "    right: .2ex;\n",
                            "    padding: .5ex;\n",
                            "    margin: .5ex;\n",
                            "    width: min-content;\n",
                            "    min-width: 20ex;\n",
                            "    max-width: 50ex;\n",
                            "    color: var(--sklearn-color-text);\n",
                            "    box-shadow: 2pt 2pt 4pt #999;\n",
                            "    background: var(--sklearn-color-level-0);\n",
                            "    border: .5pt solid var(--sklearn-color-level-3);\n",
                            "  }\n",
                            "\n",
                            "  .sk-estimator-doc-link:hover span {\n",
                            "    display: block;\n",
                            "  }\n",
                            "\n",
                            "  /* \"?\"-specific style due to the `<a>` HTML tag */\n",
                            "\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c a.estimator_doc_link {\n",
                            "    float: right;\n",
                            "    font-size: 1rem;\n",
                            "    line-height: 1em;\n",
                            "    font-family: monospace;\n",
                            "    background-color: var(--sklearn-color-background);\n",
                            "    border-radius: 1rem;\n",
                            "    height: 1rem;\n",
                            "    width: 1rem;\n",
                            "    text-decoration: none;\n",
                            "    color: var(--sklearn-color-level-1);\n",
                            "    border: var(--sklearn-color-level-1) 1pt solid;\n",
                            "  }\n",
                            "\n",
                            "  /* On hover */\n",
                            "  #sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c a.estimator_doc_link:hover {\n",
                            "    background-color: var(--sklearn-color-level-3);\n",
                            "    color: var(--sklearn-color-background);\n",
                            "    text-decoration: none;\n",
                            "  }\n",
                            "</style><div id='sk-11ab4746-dc4e-4ebc-b7e3-3b9f04ff996c' class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>TransformedTargetForecaster(steps=[TopdownReconciler(), NaiveForecaster()])</pre><b>Please rerun this cell to show the HTML repr or trust the notebook.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class='sk-label-container'><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=UUID('db2cc732-ede3-44ac-8caf-3a297a2f6981') type=\"checkbox\" ><label for=UUID('db2cc732-ede3-44ac-8caf-3a297a2f6981') class='sk-toggleable__label sk-toggleable__label-arrow'>TransformedTargetForecaster<a class=\"sk-estimator-doc-link\" rel=\"noreferrer\" target=\"_blank\" href=\"https://www.sktime.net/en/v0.36.0/api_reference/auto_generated/sktime.forecasting.compose.TransformedTargetForecaster.html\">?<span>Documentation for TransformedTargetForecaster</span></a></label><div class=\"sk-toggleable__content\"><pre>TransformedTargetForecaster(steps=[TopdownReconciler(), NaiveForecaster()])</pre></div></div></div><div class=\"sk-serial\"><div class='sk-item'><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=UUID('3f6fa38d-a6fe-4789-bb96-ade5e8167534') type=\"checkbox\" ><label for=UUID('3f6fa38d-a6fe-4789-bb96-ade5e8167534') class='sk-toggleable__label sk-toggleable__label-arrow'>TopdownReconciler<a class=\"sk-estimator-doc-link\" rel=\"noreferrer\" target=\"_blank\" href=\"https://www.sktime.net/en/v0.36.0/api_reference/auto_generated/sktime.transformations.hierarchical.reconcile.topdown.TopdownReconciler.html\">?<span>Documentation for TopdownReconciler</span></a></label><div class=\"sk-toggleable__content\"><pre>TopdownReconciler()</pre></div></div></div><div class='sk-item'><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=UUID('78010926-0d78-4598-9b50-6b6273f2e740') type=\"checkbox\" ><label for=UUID('78010926-0d78-4598-9b50-6b6273f2e740') class='sk-toggleable__label sk-toggleable__label-arrow'>NaiveForecaster<a class=\"sk-estimator-doc-link\" rel=\"noreferrer\" target=\"_blank\" href=\"https://www.sktime.net/en/v0.36.0/api_reference/auto_generated/sktime.forecasting.naive.NaiveForecaster.html\">?<span>Documentation for NaiveForecaster</span></a></label><div class=\"sk-toggleable__content\"><pre>NaiveForecaster()</pre></div></div></div></div></div></div></div>"
                        ],
                        "text/plain": [
                            "TransformedTargetForecaster(steps=[TopdownReconciler(), NaiveForecaster()])"
                        ]
                    },
                    "execution_count": 28,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.forecasting.naive import NaiveForecaster\n",
                "from sktime.transformations.hierarchical.reconcile import (\n",
                "    TopdownReconciler,\n",
                ")\n",
                "\n",
                "pipeline_to_forecast_totals = TopdownReconciler() * NaiveForecaster()\n",
                "pipeline_to_forecast_totals"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 29,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"6\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">0</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">2</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"6\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">0</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">2</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                    var_0\n",
                            "foo bar timepoints       \n",
                            "a   0   3             3.0\n",
                            "        4             3.0\n",
                            "    1   3             3.0\n",
                            "        4             3.0\n",
                            "    2   3             3.0\n",
                            "        4             3.0\n",
                            "b   0   3             3.0\n",
                            "        4             3.0\n",
                            "    1   3             3.0\n",
                            "        4             3.0\n",
                            "    2   3             3.0\n",
                            "        4             3.0"
                        ]
                    },
                    "execution_count": 29,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "pipeline_to_forecast_totals.fit(y_hier, fh=[1, 2])\n",
                "pipeline_to_forecast_totals.predict()"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Internally, the pipeline calls `reconciler.transform` to preprocess and filter the relevant data to be forecasted.\n",
                "At the end of the pipeline, the reconciler is called with `inverse_transform` to reconcile the forecasts. We can also do it step-by-step, without a pipeline."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 30,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th>0</th>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>12</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>18</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"12\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th>0</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>9</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"12\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">__total</th>\n",
                            "      <th>0</th>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>9</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            var_0\n",
                            "foo     bar     timepoints       \n",
                            "__total __total 0               6\n",
                            "                1              12\n",
                            "                2              18\n",
                            "a       0       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        1       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        2       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        __total 0               3\n",
                            "                1               6\n",
                            "                2               9\n",
                            "b       0       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        1       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        2       0               1\n",
                            "                1               2\n",
                            "                2               3\n",
                            "        __total 0               3\n",
                            "                1               6\n",
                            "                2               9"
                        ]
                    },
                    "execution_count": 30,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "reconciler = TopdownReconciler()\n",
                "y_hier_transformed = reconciler.fit_transform(y_hier)\n",
                "y_hier_transformed"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "We add some noise to showcase how it adjusts the forecasts. The inverse transform\n",
                "keeps only timeseries that were present in the original data."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 26,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"9\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>2.706654</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>1.374370</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>4.729145</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>-0.256933</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>3.035066</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>1.852927</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>0.527993</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>1.724674</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>2.218673</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"9\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
                            "      <th>0</th>\n",
                            "      <td>4.068838</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>0.886660</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>2.084540</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
                            "      <th>0</th>\n",
                            "      <td>-3.092240</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>3.127753</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>3.474135</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">2</th>\n",
                            "      <th>0</th>\n",
                            "      <td>1.991414</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2.873285</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>2.947641</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                       var_0\n",
                            "foo bar timepoints          \n",
                            "a   0   0           2.706654\n",
                            "        1           1.374370\n",
                            "        2           4.729145\n",
                            "    1   0          -0.256933\n",
                            "        1           3.035066\n",
                            "        2           1.852927\n",
                            "    2   0           0.527993\n",
                            "        1           1.724674\n",
                            "        2           2.218673\n",
                            "b   0   0           4.068838\n",
                            "        1           0.886660\n",
                            "        2           2.084540\n",
                            "    1   0          -3.092240\n",
                            "        1           3.127753\n",
                            "        2           3.474135\n",
                            "    2   0           1.991414\n",
                            "        1           2.873285\n",
                            "        2           2.947641"
                        ]
                    },
                    "execution_count": 26,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "import numpy as np\n",
                "\n",
                "y_hier_transformed_noise = y_hier_transformed + np.random.normal(\n",
                "    0, 1, y_hier_transformed.shape\n",
                ")\n",
                "\n",
                "y_hier_reconc = reconciler.inverse_transform(y_hier_transformed_noise)\n",
                "y_hier_reconc"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Using ReconcilerForecaster\n",
                "\n",
                "The `ReconcilerForecaster` wraps all reconciliation methods together with a forecaster, and, in the case of optimal reconciliation, computes the error covariance matrix. The `mint_shrink` is a optimal reconciliation method that shrinks the error covariance matrix to improve the estimate."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 31,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>var_0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>foo</th>\n",
                            "      <th>bar</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">__total</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">__total</th>\n",
                            "      <th>3</th>\n",
                            "      <td>18.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>18.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"8\" valign=\"top\">a</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">0</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">2</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">__total</th>\n",
                            "      <th>3</th>\n",
                            "      <td>9.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>9.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"8\" valign=\"top\">b</th>\n",
                            "      <th rowspan=\"2\" valign=\"top\">0</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">2</th>\n",
                            "      <th>3</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>3.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"2\" valign=\"top\">__total</th>\n",
                            "      <th>3</th>\n",
                            "      <td>9.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>9.0</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            var_0\n",
                            "foo     bar     timepoints       \n",
                            "__total __total 3            18.0\n",
                            "                4            18.0\n",
                            "a       0       3             3.0\n",
                            "                4             3.0\n",
                            "        1       3             3.0\n",
                            "                4             3.0\n",
                            "        2       3             3.0\n",
                            "                4             3.0\n",
                            "        __total 3             9.0\n",
                            "                4             9.0\n",
                            "b       0       3             3.0\n",
                            "                4             3.0\n",
                            "        1       3             3.0\n",
                            "                4             3.0\n",
                            "        2       3             3.0\n",
                            "                4             3.0\n",
                            "        __total 3             9.0\n",
                            "                4             9.0"
                        ]
                    },
                    "execution_count": 31,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.forecasting.reconcile import ReconcilerForecaster\n",
                "\n",
                "forecaster = ReconcilerForecaster(forecaster=NaiveForecaster(), method=\"mint_shrink\")\n",
                "forecaster.fit(y_hier)\n",
                "forecaster.predict(fh=[1, 2])"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Roadmap items:\n",
                "\n",
                "* reconciliation of wrapper type\n",
                "* reconciliation & Global forecasting\n",
                "* probabilistic reconciliation"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "\n",
                "## Global forecasting in `sktime`\n",
                "\n",
                "### Global forecasting/Panel forecasting - introduction\n",
                "\n",
                "Global forecasting = training **across sets of time series**, i.e., on time series **panels**.\\\n",
                "Typically better than \"fit one forecaster per time series instance\".\n",
                "\n",
                "Also called:\n",
                "\n",
                "* \"panel forecasting\", if forecasting all time series\n",
                "* \"cross-learning\", if training time series are disjoint from deployment set\n",
                "\n",
                " Why does Global forecasting matter?\n",
                "\n",
                " * In practice, we often have time series of limited range\n",
                " * Estimation is difficult, and we cannot model complex dependencies\n",
                " * Assumption of Global forecasting: We can observe the identical data generating process (DGP) multiple times\n",
                " * Non-identical DGPs can be fine too, as long as the degree of dissimilarity is captured by exogeneous information\n",
                " * Now we have much more information and can estimate more reliably and more complex models (caveat: unless complexity is purely driven by time dynamics)\n",
                " \n",
                "As a result of these advantages, Global forecasting models have been very successful in competition, e.g.\n",
                "* Rossmann Store Sales\n",
                "* Walmart Sales in Stormy Weather\n",
                "* M5 competition\n",
                "\n",
                "Many business problems in practice are essentially Global forecasting problem - often also reflecting hierarchical information (see above)\n",
                "* Product sales in different categories (e.g. M5 time series competition)\n",
                "* Balance sheet structures across cost centers / accounts\n",
                "* Dynamics of pandemics observed at different points in time\n",
                "\n",
                "Distinction to multivariate forecasting\n",
                "* Multivariate forecasting focuses on modeling interdependence between time series\n",
                "* Global forecasting can model interdependence, but focus lies on enhancing observation space\n",
                "\n",
                "Implementation in sktime\n",
                "\n",
                "* All models support panel forecasts - these may be independent or dependent\n",
                "    * some models' panel forecasts use all time series, e.g., reduction forecasters\n",
                "* Models that can train on disjoint examples (\"cross-learning\") have the `capability:global_forecasting` tag"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "### Panel forecasting with reduction forecasters"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "For the following example we will use the `\"pd-multiindex\"` representation of the `\"Panel\"` scitype (see above)\n",
                "\n",
                "Row multiindex level 0 is the unique identifier for the individual time series, level 1 contains the time index."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 21,
            "metadata": {},
            "outputs": [],
            "source": [
                "import pandas as pd\n",
                "from sklearn.ensemble import RandomForestRegressor\n",
                "from sklearn.pipeline import make_pipeline\n",
                "\n",
                "from sktime.forecasting.compose import make_reduction\n",
                "from sktime.split import temporal_train_test_split\n",
                "from sktime.transformations.series.date import DateTimeFeatures\n",
                "\n",
                "pd.options.mode.chained_assignment = None\n",
                "pd.set_option(\"display.max_columns\", None)\n",
                "\n",
                "# %%\n",
                "# Load M5 Data and prepare\n",
                "y = pd.read_pickle(\"global_fc/y.pkl\")\n",
                "X = pd.read_pickle(\"global_fc/X.pkl\")"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`y`/`X` are based on the M5 competition.\n",
                "The data features sales of products in different stores, different states and different product categories. \n",
                "\n",
                "For a detailed analysis of the competition please take a look at the paper \n",
                "\"M5 accuracy competition: Results, findings, and conclusions\".\n",
                "\n",
                "https://doi.org/10.1016/j.ijforecast.2021.11.013"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "You can see \n",
                "a glimpse of the data here:"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 22,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "                            y\n",
                        "instances timepoints         \n",
                        "1         2016-03-15   756.67\n",
                        "          2016-03-16   679.13\n",
                        "          2016-03-17   633.40\n",
                        "          2016-03-18  1158.04\n",
                        "          2016-03-19   914.24\n",
                        "                      dept_id  cat_id  store_id  state_id  event_name_1  \\\n",
                        "instances timepoints                                                      \n",
                        "1         2016-03-15        1       1        10         3             1   \n",
                        "          2016-03-16        1       1        10         3             1   \n",
                        "          2016-03-17        1       1        10         3             7   \n",
                        "          2016-03-18        1       1        10         3             1   \n",
                        "          2016-03-19        1       1        10         3             1   \n",
                        "\n",
                        "                      event_type_1  event_name_2  event_type_2  snap  \\\n",
                        "instances timepoints                                                   \n",
                        "1         2016-03-15             1             1             1     3   \n",
                        "          2016-03-16             1             1             1     0   \n",
                        "          2016-03-17             3             1             1     0   \n",
                        "          2016-03-18             1             1             1     0   \n",
                        "          2016-03-19             1             1             1     0   \n",
                        "\n",
                        "                      no_stock_days  \n",
                        "instances timepoints                 \n",
                        "1         2016-03-15              0  \n",
                        "          2016-03-16              0  \n",
                        "          2016-03-17              0  \n",
                        "          2016-03-18              0  \n",
                        "          2016-03-19              0  \n"
                    ]
                }
            ],
            "source": [
                "print(y.head())\n",
                "print(X.head())"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "\n",
                "* time series grouped via the instances argument in the first column = Panel\n",
                "* focus on modeling individual products\n",
                "* hierarchical information is provided as exgoneous information. \n",
                "\n",
                "For the M5 competition, winning solution used exogeneous features about the hierarchies like `\"dept_id\"`, `\"store_id\"` etc. to capture similarities and dissimilarities of the products. Other features include holiday events and snap days (specific assistance program of US social security paid on certain days)."
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "now split into test and train set using `temporal_train_test_split`.\\\n",
                "we can cut every instance of the time series individually:\n"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 23,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>y</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">1</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>756.67</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-16</th>\n",
                            "      <td>679.13</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-17</th>\n",
                            "      <td>633.40</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-18</th>\n",
                            "      <td>1158.04</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-19</th>\n",
                            "      <td>914.24</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            y\n",
                            "instances timepoints         \n",
                            "1         2016-03-15   756.67\n",
                            "          2016-03-16   679.13\n",
                            "          2016-03-17   633.40\n",
                            "          2016-03-18  1158.04\n",
                            "          2016-03-19   914.24"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>y</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">1</th>\n",
                            "      <th>2016-04-14</th>\n",
                            "      <td>874.57</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-15</th>\n",
                            "      <td>895.29</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-16</th>\n",
                            "      <td>1112.63</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-17</th>\n",
                            "      <td>1014.86</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-18</th>\n",
                            "      <td>691.91</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            y\n",
                            "instances timepoints         \n",
                            "1         2016-04-14   874.57\n",
                            "          2016-04-15   895.29\n",
                            "          2016-04-16  1112.63\n",
                            "          2016-04-17  1014.86\n",
                            "          2016-04-18   691.91"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "y_train, y_test, X_train, X_test = temporal_train_test_split(y, X)\n",
                "print(y_train.head(5))\n",
                "print(y_test.head(5))"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "both `y` and `X` are split in the same way, and hierarchy structures are preserved."
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Rationale for tree based models\n",
                "\n",
                "Tree ensembles exploit complex non-linear relationships / dependencies between time series and covariates.\n",
                "\n",
                "In **univariate time series forecasting**, tree based models often do not perform well due to lack of data.\n",
                "\n",
                "Due to large effective sample sizes in **Global forecasting** , tree ensembles can become a good choice (e.g., 42,840 time series in the M5 competition).\n",
                "\n",
                "sktime can interface any sklearn compatible model via reduction, e.g., `RandomForestRegressor`."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 24,
            "metadata": {},
            "outputs": [],
            "source": [
                "regressor = make_pipeline(\n",
                "    RandomForestRegressor(random_state=1),\n",
                ")"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Caveat: reduction applies a supervised regressor to a time series, i.e., to a task for which they were not originally designed.\n",
                "\n",
                "This issue can be addressed by generating features that capture the dynamics of the time series.\\\n",
                "`\"WindowSummarizer\"` can be used to generate features useful for time series forecasting,\\\n",
                " based on a provided dictionary of functions, window shifts and window lengths:"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 25,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>y_lag_1</th>\n",
                            "      <th>y_mean_1_3</th>\n",
                            "      <th>y_mean_3_6</th>\n",
                            "      <th>y_std_1_4</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-16</th>\n",
                            "      <td>756.67</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-17</th>\n",
                            "      <td>679.13</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-18</th>\n",
                            "      <td>633.40</td>\n",
                            "      <td>689.733333</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-19</th>\n",
                            "      <td>1158.04</td>\n",
                            "      <td>823.523333</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>239.617572</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-20</th>\n",
                            "      <td>914.24</td>\n",
                            "      <td>901.893333</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>241.571143</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-21</th>\n",
                            "      <td>965.27</td>\n",
                            "      <td>1012.516667</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>216.690775</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-22</th>\n",
                            "      <td>630.77</td>\n",
                            "      <td>836.760000</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>217.842052</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-23</th>\n",
                            "      <td>702.79</td>\n",
                            "      <td>766.276667</td>\n",
                            "      <td>851.125000</td>\n",
                            "      <td>161.669232</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-24</th>\n",
                            "      <td>728.15</td>\n",
                            "      <td>687.236667</td>\n",
                            "      <td>830.141667</td>\n",
                            "      <td>145.007117</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                      y_lag_1   y_mean_1_3  y_mean_3_6   y_std_1_4\n",
                            "instances timepoints                                              \n",
                            "1         2016-03-15      NaN          NaN         NaN         NaN\n",
                            "          2016-03-16   756.67          NaN         NaN         NaN\n",
                            "          2016-03-17   679.13          NaN         NaN         NaN\n",
                            "          2016-03-18   633.40   689.733333         NaN         NaN\n",
                            "          2016-03-19  1158.04   823.523333         NaN  239.617572\n",
                            "          2016-03-20   914.24   901.893333         NaN  241.571143\n",
                            "          2016-03-21   965.27  1012.516667         NaN  216.690775\n",
                            "          2016-03-22   630.77   836.760000         NaN  217.842052\n",
                            "          2016-03-23   702.79   766.276667  851.125000  161.669232\n",
                            "          2016-03-24   728.15   687.236667  830.141667  145.007117"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "import pandas as pd\n",
                "\n",
                "from sktime.forecasting.base import ForecastingHorizon\n",
                "from sktime.forecasting.compose import ForecastingPipeline\n",
                "from sktime.transformations.series.summarize import WindowSummarizer\n",
                "\n",
                "kwargs = {\n",
                "    \"lag_feature\": {\n",
                "        \"lag\": [1],\n",
                "        \"mean\": [[1, 3], [3, 6]],\n",
                "        \"std\": [[1, 4]],\n",
                "    }\n",
                "}\n",
                "\n",
                "transformer = WindowSummarizer(**kwargs)\n",
                "y_transformed = transformer.fit_transform(y_train)\n",
                "\n",
                "y_transformed.head(10)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "The notation `\"mean\": [[1, 3]]` (captured in the column `\"y_mean_1_3\"`) is read as:\n",
                "\n",
                "summarization function `\"mean\": [[1, 3]]` is applied to:\n",
                "\n",
                "* window of length 3\n",
                "* start (inclusive) is lagged by one period\n",
                "\n",
                "Visualization:\n",
                "\n",
                "For z = target time stamp:\\\n",
                "`window = [1, 3]`, means a `lag` of 1 and `window_length` of 3, selecting the three last days (exclusive z).\n",
                "\n",
                "Summarization is done across windows like this:\n",
                "\n",
                "| x x x x x x x x * * * z x |\n",
                "|---------------------------|"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "By default, `\"WindowSummarizer\"` uses pandas rolling window functions to allow for a speedy generation of features. \n",
                "* \"sum\",\n",
                "* \"mean\",\n",
                "* \"median\",\n",
                "* \"std\",\n",
                "* \"var\",\n",
                "* \"kurt\",\n",
                "* \"min\",\n",
                "* \"max\",\n",
                "* \"corr\",\n",
                "* \"cov\",\n",
                "* \"skew\",\n",
                "* \"sem\"\n",
                "\n",
                "typically very fast since optimized for rolling, grouped operations\n",
                "\n",
                "In the M5 competition, arguably the most relevant features were:\n",
                "\n",
                "* **mean** calculations to capture level shifts, e.g. last week sales, sales of the week prior to the last month etc.\n",
                "* **standard deviation** to capture increases / decreases in volatility in sales, and how it impacts future sales\n",
                "* rolling **skewness** / **kurtosis** calculations, to capture changes in store sales tendencies.\n",
                "* various different calculations to capture periods of zero sales (e.g. out of stock scenarios)\n",
                "\n",
                "First three are available via native pandas functions.\\\n",
                "`WindowSummarizer` can also be provided with arbitrary summarizer functions.\n",
                "\n",
                "Example: function `count_gt130` to count how many observations lie above the threshold of 130 within a window of length 3, lagged by 2 periods."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 26,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>y_lag_1</th>\n",
                            "      <th>y_count_gt130_2_3</th>\n",
                            "      <th>y_std_1_4</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-16</th>\n",
                            "      <td>756.67</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-17</th>\n",
                            "      <td>679.13</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-18</th>\n",
                            "      <td>633.40</td>\n",
                            "      <td>NaN</td>\n",
                            "      <td>NaN</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-19</th>\n",
                            "      <td>1158.04</td>\n",
                            "      <td>1.0</td>\n",
                            "      <td>239.617572</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-20</th>\n",
                            "      <td>914.24</td>\n",
                            "      <td>1.0</td>\n",
                            "      <td>241.571143</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-21</th>\n",
                            "      <td>965.27</td>\n",
                            "      <td>2.0</td>\n",
                            "      <td>216.690775</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-22</th>\n",
                            "      <td>630.77</td>\n",
                            "      <td>3.0</td>\n",
                            "      <td>217.842052</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-23</th>\n",
                            "      <td>702.79</td>\n",
                            "      <td>2.0</td>\n",
                            "      <td>161.669232</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-24</th>\n",
                            "      <td>728.15</td>\n",
                            "      <td>2.0</td>\n",
                            "      <td>145.007117</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                      y_lag_1  y_count_gt130_2_3   y_std_1_4\n",
                            "instances timepoints                                        \n",
                            "1         2016-03-15      NaN                NaN         NaN\n",
                            "          2016-03-16   756.67                NaN         NaN\n",
                            "          2016-03-17   679.13                NaN         NaN\n",
                            "          2016-03-18   633.40                NaN         NaN\n",
                            "          2016-03-19  1158.04                1.0  239.617572\n",
                            "          2016-03-20   914.24                1.0  241.571143\n",
                            "          2016-03-21   965.27                2.0  216.690775\n",
                            "          2016-03-22   630.77                3.0  217.842052\n",
                            "          2016-03-23   702.79                2.0  161.669232\n",
                            "          2016-03-24   728.15                2.0  145.007117"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "import numpy as np\n",
                "\n",
                "\n",
                "def count_gt130(x):\n",
                "    \"\"\"Count how many observations lie above threshold 130.\"\"\"\n",
                "    return np.sum((x > 700)[::-1])\n",
                "\n",
                "\n",
                "kwargs = {\n",
                "    \"lag_feature\": {\n",
                "        \"lag\": [1],\n",
                "        count_gt130: [[2, 3]],\n",
                "        \"std\": [[1, 4]],\n",
                "    }\n",
                "}\n",
                "\n",
                "transformer = WindowSummarizer(**kwargs)\n",
                "y_transformed = transformer.fit_transform(y_train)\n",
                "\n",
                "y_transformed.head(10)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Above applies `\"WindowSummarizer\"` to the forecasting targey `y`.\n",
                "\n",
                "To apply `\"WindowSummarizer\"` to columns in `X`, use `\"WindowSummarizer\"` within a `\"ForecastingPipeline\"` and specify `\"target_cols\"`.\n",
                "\n",
                "In the M5 competition, lagging of exogeneous features was especially useful for lags around holiday dummies (often sales are affected for a few days before and after major holidays) as well as changes in item prices (discounts as well as persistent price changes)"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 27,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/plain": [
                            "1959    67075.727273\n",
                            "1960    67638.454545\n",
                            "1961    68201.181818\n",
                            "1962    68763.909091\n",
                            "Freq: A-DEC, dtype: float64"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "from sktime.datasets import load_longley\n",
                "from sktime.forecasting.naive import NaiveForecaster\n",
                "\n",
                "y_ll, X_ll = load_longley()\n",
                "y_train_ll, y_test_ll, X_train_ll, X_test_ll = temporal_train_test_split(y_ll, X_ll)\n",
                "fh = ForecastingHorizon(X_test_ll.index, is_relative=False)\n",
                "# Example transforming only X\n",
                "pipe = ForecastingPipeline(\n",
                "    steps=[\n",
                "        (\"a\", WindowSummarizer(n_jobs=1, target_cols=[\"POP\", \"GNPDEFL\"])),\n",
                "        (\"b\", WindowSummarizer(n_jobs=1, target_cols=[\"GNP\"], **kwargs)),\n",
                "        (\"forecaster\", NaiveForecaster(strategy=\"drift\")),\n",
                "    ]\n",
                ")\n",
                "pipe_return = pipe.fit(y_train_ll, X_train_ll)\n",
                "y_pred1 = pipe_return.predict(fh=fh, X=X_test_ll)\n",
                "\n",
                "y_pred1"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "For efficiency, relevant features are computed in a parallel way.\\\n",
                "For maximum parallelization, pass `WindowSummarizer` as a single transformer within `make_reduction`. \n",
                "\n",
                "In this case, `window_length` is inferred from the `WindowSummarizer` and need not be passed to `make_reduction`."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 28,
            "metadata": {},
            "outputs": [],
            "source": [
                "forecaster = make_reduction(\n",
                "    regressor,\n",
                "    transformers=[WindowSummarizer(**kwargs, n_jobs=1)],\n",
                "    window_length=None,\n",
                "    strategy=\"recursive\",\n",
                "    pooling=\"global\",\n",
                ")"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Concepts relating to calendar seasonalities need to be provided by means of feature engineering to most models. Examples:\n",
                "\n",
                "* day of the week effects historically observed for stock prices (prices on Fridays used to differ from Monday prices).\n",
                "* used car prices being higher in spring than in summer\n",
                "* spendings at the beginning of the month differing from end of month due to salary effects.\n",
                "\n",
                "Calendar seasonalities can be modeled by means of dummy variables or fourier terms. As a rule of thumb, use dummy variables for discontinuous effects and fourier/period/seasonality terms when you believe there is a certain degree of smoothness in the seasonality.\n",
                "\n",
                "`sktime` supports calendar dummy features via the `DateTimeFeatures` transformer. Manually specify the desired seasonality, or provide base frequency of the time series (daily, weekly etc.) and the desired complexity (few vs many features), `DateTimeFeatures` can infer sensible seasonality."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 29,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>year</th>\n",
                            "      <th>month</th>\n",
                            "      <th>weekday</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"30\" valign=\"top\">1</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-16</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-17</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-18</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-19</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-20</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-21</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-22</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-23</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-24</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-25</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-26</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-27</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-28</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-29</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-30</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-31</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-01</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-02</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-03</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-04</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-05</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-06</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-07</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-08</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-09</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-10</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-11</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-12</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-13</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"30\" valign=\"top\">2</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-16</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-17</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-18</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-19</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-20</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-21</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-22</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-23</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-24</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-25</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-26</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-27</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-28</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-29</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-30</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-31</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>3</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-01</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-02</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-03</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-04</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-05</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-06</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-07</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-08</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-09</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-10</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>6</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-11</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-12</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-13</th>\n",
                            "      <td>2016</td>\n",
                            "      <td>4</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                      year  month  weekday\n",
                            "instances timepoints                      \n",
                            "1         2016-03-15  2016      3        1\n",
                            "          2016-03-16  2016      3        2\n",
                            "          2016-03-17  2016      3        3\n",
                            "          2016-03-18  2016      3        4\n",
                            "          2016-03-19  2016      3        5\n",
                            "          2016-03-20  2016      3        6\n",
                            "          2016-03-21  2016      3        0\n",
                            "          2016-03-22  2016      3        1\n",
                            "          2016-03-23  2016      3        2\n",
                            "          2016-03-24  2016      3        3\n",
                            "          2016-03-25  2016      3        4\n",
                            "          2016-03-26  2016      3        5\n",
                            "          2016-03-27  2016      3        6\n",
                            "          2016-03-28  2016      3        0\n",
                            "          2016-03-29  2016      3        1\n",
                            "          2016-03-30  2016      3        2\n",
                            "          2016-03-31  2016      3        3\n",
                            "          2016-04-01  2016      4        4\n",
                            "          2016-04-02  2016      4        5\n",
                            "          2016-04-03  2016      4        6\n",
                            "          2016-04-04  2016      4        0\n",
                            "          2016-04-05  2016      4        1\n",
                            "          2016-04-06  2016      4        2\n",
                            "          2016-04-07  2016      4        3\n",
                            "          2016-04-08  2016      4        4\n",
                            "          2016-04-09  2016      4        5\n",
                            "          2016-04-10  2016      4        6\n",
                            "          2016-04-11  2016      4        0\n",
                            "          2016-04-12  2016      4        1\n",
                            "          2016-04-13  2016      4        2\n",
                            "2         2016-03-15  2016      3        1\n",
                            "          2016-03-16  2016      3        2\n",
                            "          2016-03-17  2016      3        3\n",
                            "          2016-03-18  2016      3        4\n",
                            "          2016-03-19  2016      3        5\n",
                            "          2016-03-20  2016      3        6\n",
                            "          2016-03-21  2016      3        0\n",
                            "          2016-03-22  2016      3        1\n",
                            "          2016-03-23  2016      3        2\n",
                            "          2016-03-24  2016      3        3\n",
                            "          2016-03-25  2016      3        4\n",
                            "          2016-03-26  2016      3        5\n",
                            "          2016-03-27  2016      3        6\n",
                            "          2016-03-28  2016      3        0\n",
                            "          2016-03-29  2016      3        1\n",
                            "          2016-03-30  2016      3        2\n",
                            "          2016-03-31  2016      3        3\n",
                            "          2016-04-01  2016      4        4\n",
                            "          2016-04-02  2016      4        5\n",
                            "          2016-04-03  2016      4        6\n",
                            "          2016-04-04  2016      4        0\n",
                            "          2016-04-05  2016      4        1\n",
                            "          2016-04-06  2016      4        2\n",
                            "          2016-04-07  2016      4        3\n",
                            "          2016-04-08  2016      4        4\n",
                            "          2016-04-09  2016      4        5\n",
                            "          2016-04-10  2016      4        6\n",
                            "          2016-04-11  2016      4        0\n",
                            "          2016-04-12  2016      4        1\n",
                            "          2016-04-13  2016      4        2"
                        ]
                    },
                    "execution_count": 29,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "transformer = DateTimeFeatures(ts_freq=\"D\")\n",
                "X_hat = transformer.fit_transform(X_train)\n",
                "\n",
                "new_cols = [i for i in X_hat if i not in X_train.columns]\n",
                "X_hat[new_cols]"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "DateTimeFeatures supports the following frequencies:\n",
                "* Y - year\n",
                "* Q - quarter\n",
                "* M - month\n",
                "* W - week\n",
                "* D - day\n",
                "* H - hour\n",
                "* T - minute\n",
                "* S - second\n",
                "* L - millisecond\n",
                "\n",
                "You can specify the manual generation of dummy features with the notation e.g. \"day_of_month\", \"day_of_week\", \"week_of_quarter\". "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 30,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>day_of_quarter</th>\n",
                            "      <th>week_of_month</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"30\" valign=\"top\">1</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>75</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-16</th>\n",
                            "      <td>76</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-17</th>\n",
                            "      <td>77</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-18</th>\n",
                            "      <td>78</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-19</th>\n",
                            "      <td>79</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-20</th>\n",
                            "      <td>80</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-21</th>\n",
                            "      <td>81</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-22</th>\n",
                            "      <td>82</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-23</th>\n",
                            "      <td>83</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-24</th>\n",
                            "      <td>84</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-25</th>\n",
                            "      <td>85</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-26</th>\n",
                            "      <td>86</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-27</th>\n",
                            "      <td>87</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-28</th>\n",
                            "      <td>88</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-29</th>\n",
                            "      <td>89</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-30</th>\n",
                            "      <td>90</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-31</th>\n",
                            "      <td>91</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-01</th>\n",
                            "      <td>1</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-02</th>\n",
                            "      <td>2</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-03</th>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-04</th>\n",
                            "      <td>4</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-05</th>\n",
                            "      <td>5</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-06</th>\n",
                            "      <td>6</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-07</th>\n",
                            "      <td>7</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-08</th>\n",
                            "      <td>8</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-09</th>\n",
                            "      <td>9</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-10</th>\n",
                            "      <td>10</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-11</th>\n",
                            "      <td>11</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-12</th>\n",
                            "      <td>12</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-13</th>\n",
                            "      <td>13</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"30\" valign=\"top\">2</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>75</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-16</th>\n",
                            "      <td>76</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-17</th>\n",
                            "      <td>77</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-18</th>\n",
                            "      <td>78</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-19</th>\n",
                            "      <td>79</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-20</th>\n",
                            "      <td>80</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-21</th>\n",
                            "      <td>81</td>\n",
                            "      <td>3</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-22</th>\n",
                            "      <td>82</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-23</th>\n",
                            "      <td>83</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-24</th>\n",
                            "      <td>84</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-25</th>\n",
                            "      <td>85</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-26</th>\n",
                            "      <td>86</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-27</th>\n",
                            "      <td>87</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-28</th>\n",
                            "      <td>88</td>\n",
                            "      <td>4</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-29</th>\n",
                            "      <td>89</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-30</th>\n",
                            "      <td>90</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-03-31</th>\n",
                            "      <td>91</td>\n",
                            "      <td>5</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-01</th>\n",
                            "      <td>1</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-02</th>\n",
                            "      <td>2</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-03</th>\n",
                            "      <td>3</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-04</th>\n",
                            "      <td>4</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-05</th>\n",
                            "      <td>5</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-06</th>\n",
                            "      <td>6</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-07</th>\n",
                            "      <td>7</td>\n",
                            "      <td>1</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-08</th>\n",
                            "      <td>8</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-09</th>\n",
                            "      <td>9</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-10</th>\n",
                            "      <td>10</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-11</th>\n",
                            "      <td>11</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-12</th>\n",
                            "      <td>12</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2016-04-13</th>\n",
                            "      <td>13</td>\n",
                            "      <td>2</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                      day_of_quarter  week_of_month\n",
                            "instances timepoints                               \n",
                            "1         2016-03-15              75              3\n",
                            "          2016-03-16              76              3\n",
                            "          2016-03-17              77              3\n",
                            "          2016-03-18              78              3\n",
                            "          2016-03-19              79              3\n",
                            "          2016-03-20              80              3\n",
                            "          2016-03-21              81              3\n",
                            "          2016-03-22              82              4\n",
                            "          2016-03-23              83              4\n",
                            "          2016-03-24              84              4\n",
                            "          2016-03-25              85              4\n",
                            "          2016-03-26              86              4\n",
                            "          2016-03-27              87              4\n",
                            "          2016-03-28              88              4\n",
                            "          2016-03-29              89              5\n",
                            "          2016-03-30              90              5\n",
                            "          2016-03-31              91              5\n",
                            "          2016-04-01               1              1\n",
                            "          2016-04-02               2              1\n",
                            "          2016-04-03               3              1\n",
                            "          2016-04-04               4              1\n",
                            "          2016-04-05               5              1\n",
                            "          2016-04-06               6              1\n",
                            "          2016-04-07               7              1\n",
                            "          2016-04-08               8              2\n",
                            "          2016-04-09               9              2\n",
                            "          2016-04-10              10              2\n",
                            "          2016-04-11              11              2\n",
                            "          2016-04-12              12              2\n",
                            "          2016-04-13              13              2\n",
                            "2         2016-03-15              75              3\n",
                            "          2016-03-16              76              3\n",
                            "          2016-03-17              77              3\n",
                            "          2016-03-18              78              3\n",
                            "          2016-03-19              79              3\n",
                            "          2016-03-20              80              3\n",
                            "          2016-03-21              81              3\n",
                            "          2016-03-22              82              4\n",
                            "          2016-03-23              83              4\n",
                            "          2016-03-24              84              4\n",
                            "          2016-03-25              85              4\n",
                            "          2016-03-26              86              4\n",
                            "          2016-03-27              87              4\n",
                            "          2016-03-28              88              4\n",
                            "          2016-03-29              89              5\n",
                            "          2016-03-30              90              5\n",
                            "          2016-03-31              91              5\n",
                            "          2016-04-01               1              1\n",
                            "          2016-04-02               2              1\n",
                            "          2016-04-03               3              1\n",
                            "          2016-04-04               4              1\n",
                            "          2016-04-05               5              1\n",
                            "          2016-04-06               6              1\n",
                            "          2016-04-07               7              1\n",
                            "          2016-04-08               8              2\n",
                            "          2016-04-09               9              2\n",
                            "          2016-04-10              10              2\n",
                            "          2016-04-11              11              2\n",
                            "          2016-04-12              12              2\n",
                            "          2016-04-13              13              2"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "transformer = DateTimeFeatures(manual_selection=[\"week_of_month\", \"day_of_quarter\"])\n",
                "X_hat = transformer.fit_transform(X_train)\n",
                "\n",
                "new_cols = [i for i in X_hat if i not in X_train.columns]\n",
                "X_hat[new_cols]"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Putting it all together\n",
                "\n",
                "Using the `\"WindowSummarizer\"`, `\"DateTimeFeatures\"` and the `\"make_reduction\"` function we can now set up a working example of a an end to end Global forecasting pipeline based on a sample of the M5 competition data:"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 31,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>y</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>instances</th>\n",
                            "      <th>timepoints</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>756.67</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <th>2016-03-15</th>\n",
                            "      <td>1901.15</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                            y\n",
                            "instances timepoints         \n",
                            "1         2016-03-15   756.67\n",
                            "2         2016-03-15  1901.15"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "pipe = ForecastingPipeline(\n",
                "    steps=[\n",
                "        (\n",
                "            \"event_dynamics\",\n",
                "            WindowSummarizer(\n",
                "                n_jobs=-1, **kwargs, target_cols=[\"event_type_1\", \"event_type_2\"]\n",
                "            ),\n",
                "        ),\n",
                "        (\"snap_dynamics\", WindowSummarizer(n_jobs=-1, target_cols=[\"snap\"])),\n",
                "        (\"daily_season\", DateTimeFeatures(ts_freq=\"D\")),\n",
                "        (\"forecaster\", forecaster),\n",
                "    ]\n",
                ")\n",
                "\n",
                "pipe_return = pipe.fit(y_train, X_train)\n",
                "y_pred1 = pipe_return.predict(fh=1, X=X_test)\n",
                "\n",
                "y_pred1"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "## Building your own hierarchical forecaster\n",
                "\n",
                "Getting started:\n",
                "\n",
                "* follow the [\"implementing estimator\" developer guide](https://www.sktime.net/en/stable/developer_guide/add_estimators.html)\n",
                "* use the advanced [forecasting extension template](https://github.com/sktime/sktime/blob/main/extension_templates/forecasting.py)\n",
                "\n",
                "Extension template = python \"fill-in\" template with to-do blocks that allow you to implement your own, sktime-compatible forecasting algorithm.\n",
                "\n",
                "Check estimators using `check_estimator`\n",
                "\n",
                "For hierarchical forecasting:\n",
                "\n",
                "* ensure to pick supported mtypes for panel and hierarchical data\n",
                "* recommended: `y_inner_mtype = [\"pd.DataFrame\", \"pd-multiindex\", \"pd_multiindex_hier\"]`, same for `X_inner_mtype`\n",
                "    * this ensures the inputs `y`, `X` seen in `_fit`, `_predict` are `pd.DataFrame`, with 1, 2, 3 or more row levels\n",
                "* you can implement vectorization over rows if efficient implementation is available\n",
                "    * but: automated vectorization already loops over row index sets, don't implement that if that's what \"hierarchical\" is\n",
                "    * to ensure automated vectorization, do *not* include Hierarchical or Panel mtypes in `y_inner_mtype`, `X_inner_mtype`\n",
                "* think carefully whether your estimator is a forecaster, or can be decomposed in a transformer\n",
                "    * \"do X and then apply forecaster already in sktime\" is a strong hint that you actually want to implement a transformer\n"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "\n",
                "### Global Forecasting with deep learning models and transformers"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "1. What is global forecast about?\n",
                "  \n",
                "    A lot of deep learning models will \n",
                "    \n",
                "    - train on large dataset which containing many time series from many instances \n",
                "    - predict on time series from other instances beyond training data. \n",
                "    \n",
                "    The ability to train on many series and predict beyond training data is called global forecast.\n",
                "\n",
                "2. How is global forecast formulated?\n",
                "\n",
                "   - train on dataset containing $n$ time series $\\{x_{i_1}, x_{i_2}, x_{i_3}, ..., x_{i_n}\\}$\n",
                "   - predict on another set of time series $\\{x_{j_1}, x_{j_2}, x_{j_3}, ..., x_{j_m}\\}$\n",
                "   - $m$ is not required to be equal to $n$\n",
                "   - there might or might not be intersection between the sets $\\{i_1,.., i_n\\}$ and $\\{j_1, ... j_m\\}$\n"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "To check the global forecast ability of one forecaster in sktime, you can check the `capability:global_forecasting` tag."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 32,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/plain": [
                            "True"
                        ]
                    },
                    "execution_count": 32,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.forecasting.pytorchforecasting import PytorchForecastingDeepAR\n",
                "\n",
                "PytorchForecastingDeepAR().get_tag(\n",
                "    \"capability:global_forecasting\"\n",
                ")  # should return True"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Global Forecasting without exogeneous data"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "You can pass $n$ series of `y` to `fit` and then predict on other $m$ series different from data in training. "
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "First we generate 90 series for training and 10 series to predict."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 33,
            "metadata": {},
            "outputs": [],
            "source": [
                "from sklearn.model_selection import train_test_split\n",
                "\n",
                "from sktime.utils._testing.hierarchical import _make_hierarchical\n",
                "\n",
                "data = _make_hierarchical(\n",
                "    hierarchy_levels=(100, 1), max_timepoints=10, min_timepoints=10, n_columns=1\n",
                ")\n",
                "data = data.droplevel(1)\n",
                "y_train, y_test = train_test_split(data, test_size=0.1, train_size=0.9, shuffle=False)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`y_train` is the series we want to fit on which contains the first 90% of the time series instances."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 34,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>c0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_0</th>\n",
                            "      <th>2000-01-01</th>\n",
                            "      <td>2.800129</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-02</th>\n",
                            "      <td>5.385355</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-03</th>\n",
                            "      <td>3.938048</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-04</th>\n",
                            "      <td>4.838710</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-05</th>\n",
                            "      <td>3.744334</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>...</th>\n",
                            "      <th>...</th>\n",
                            "      <td>...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_89</th>\n",
                            "      <th>2000-01-06</th>\n",
                            "      <td>5.662998</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-07</th>\n",
                            "      <td>3.283564</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>3.652488</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>6.173749</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.208331</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "<p>900 rows × 1 columns</p>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                        c0\n",
                            "h0    time                \n",
                            "h0_0  2000-01-01  2.800129\n",
                            "      2000-01-02  5.385355\n",
                            "      2000-01-03  3.938048\n",
                            "      2000-01-04  4.838710\n",
                            "      2000-01-05  3.744334\n",
                            "...                    ...\n",
                            "h0_89 2000-01-06  5.662998\n",
                            "      2000-01-07  3.283564\n",
                            "      2000-01-08  3.652488\n",
                            "      2000-01-09  6.173749\n",
                            "      2000-01-10  5.208331\n",
                            "\n",
                            "[900 rows x 1 columns]"
                        ]
                    },
                    "execution_count": 34,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "y_train"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`y_test` is the series we want to predict on which contains the last 10% of the time series instances."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 35,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>c0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_90</th>\n",
                            "      <th>2000-01-01</th>\n",
                            "      <td>3.761360</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-02</th>\n",
                            "      <td>3.931633</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-03</th>\n",
                            "      <td>4.486252</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-04</th>\n",
                            "      <td>3.225777</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-05</th>\n",
                            "      <td>4.567175</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>...</th>\n",
                            "      <th>...</th>\n",
                            "      <td>...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_99</th>\n",
                            "      <th>2000-01-06</th>\n",
                            "      <td>3.954103</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-07</th>\n",
                            "      <td>3.168133</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>4.330946</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>4.586232</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>4.600275</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "<p>100 rows × 1 columns</p>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                        c0\n",
                            "h0    time                \n",
                            "h0_90 2000-01-01  3.761360\n",
                            "      2000-01-02  3.931633\n",
                            "      2000-01-03  4.486252\n",
                            "      2000-01-04  3.225777\n",
                            "      2000-01-05  4.567175\n",
                            "...                    ...\n",
                            "h0_99 2000-01-06  3.954103\n",
                            "      2000-01-07  3.168133\n",
                            "      2000-01-08  4.330946\n",
                            "      2000-01-09  4.586232\n",
                            "      2000-01-10  4.600275\n",
                            "\n",
                            "[100 rows x 1 columns]"
                        ]
                    },
                    "execution_count": 35,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "y_test"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "You can see that `y_train` and `y_test` are different on hierarchical level `h0` which indicates that they come from different instances.\n",
                "\n",
                "We can initialize a gloabl forecaster to fit on `y_train` and predict on `y_test`."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 36,
            "metadata": {},
            "outputs": [],
            "source": [
                "from sktime.forecasting.pytorchforecasting import PytorchForecastingNBeats\n",
                "\n",
                "model = PytorchForecastingNBeats(\n",
                "    trainer_params={\n",
                "        \"max_epochs\": 5,  # for quick test\n",
                "        \"limit_train_batches\": 50,  # for quick test\n",
                "    },\n",
                "    dataset_params={\n",
                "        \"max_encoder_length\": 3,\n",
                "    },\n",
                ")"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 37,
            "metadata": {},
            "outputs": [
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "GPU available: True (cuda), used: True\n",
                        "TPU available: False, using: 0 TPU cores\n",
                        "IPU available: False, using: 0 IPUs\n",
                        "HPU available: False, using: 0 HPUs\n",
                        "You are using a CUDA device ('NVIDIA GeForce RTX 3060') that has Tensor Cores. To properly utilize them, you should set `torch.set_float32_matmul_precision('medium' | 'high')` which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision\n",
                        "2024-08-01 16:35:52.693686: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
                        "2024-08-01 16:35:52.719912: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
                        "To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
                        "2024-08-01 16:35:53.197118: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
                        "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n",
                        "\n",
                        "  | Name            | Type       | Params\n",
                        "-----------------------------------------------\n",
                        "0 | loss            | MASE       | 0     \n",
                        "1 | logging_metrics | ModuleList | 0     \n",
                        "2 | net_blocks      | ModuleList | 1.6 M \n",
                        "-----------------------------------------------\n",
                        "1.6 M     Trainable params\n",
                        "0         Non-trainable params\n",
                        "1.6 M     Total params\n",
                        "6.375     Total estimated model params size (MB)\n"
                    ]
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "ab6e504e416640c18bf4e2355ec5e4e2",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Sanity Checking: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "24aceb734bc243d88147806d8448232d",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Training: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "3180b8e218674d7fa8e9997f3229fbef",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "00a0980a8b1e4edaa30ed12517c8e9ed",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "af7e75ee15104909b2a9f02d9ceccb4d",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "94bf8a5856b940aebb4101249621e2f1",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "c805c86ee094496ba5d4b2d9f649e46b",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "`Trainer.fit` stopped: `max_epochs=5` reached.\n"
                    ]
                },
                {
                    "data": {
                        "text/html": [
                            "<style>#sk-e3a63ee6-940f-40dc-828b-221f2992f70b {color: black;background-color: white;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b pre{padding: 0;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-toggleable {background-color: white;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-estimator:hover {background-color: #d4ebff;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-item {z-index: 1;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-parallel::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-parallel-item {display: flex;flex-direction: column;position: relative;background-color: white;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-parallel-item:only-child::after {width: 0;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;position: relative;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-label label {font-family: monospace;font-weight: bold;background-color: white;display: inline-block;line-height: 1.2em;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-label-container {position: relative;z-index: 2;text-align: center;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-e3a63ee6-940f-40dc-828b-221f2992f70b div.sk-text-repr-fallback {display: none;}</style><div id='sk-e3a63ee6-940f-40dc-828b-221f2992f70b' class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>PytorchForecastingNBeats(dataset_params={&#x27;max_encoder_length&#x27;: 3},\n",
                            "                         trainer_params={&#x27;limit_train_batches&#x27;: 50,\n",
                            "                                         &#x27;max_epochs&#x27;: 5})</pre><b>Please rerun this cell to show the HTML repr or trust the notebook.</b></div><div class=\"sk-container\" hidden><div class='sk-item'><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=UUID('cb3a9589-bc47-4aed-a9a2-7c7b60b62b68') type=\"checkbox\" checked><label for=UUID('cb3a9589-bc47-4aed-a9a2-7c7b60b62b68') class='sk-toggleable__label sk-toggleable__label-arrow'>PytorchForecastingNBeats</label><div class=\"sk-toggleable__content\"><pre>PytorchForecastingNBeats(dataset_params={&#x27;max_encoder_length&#x27;: 3},\n",
                            "                         trainer_params={&#x27;limit_train_batches&#x27;: 50,\n",
                            "                                         &#x27;max_epochs&#x27;: 5})</pre></div></div></div></div></div>"
                        ],
                        "text/plain": [
                            "PytorchForecastingNBeats(dataset_params={'max_encoder_length': 3},\n",
                            "                         trainer_params={'limit_train_batches': 50,\n",
                            "                                         'max_epochs': 5})"
                        ]
                    },
                    "execution_count": 37,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "from sktime.forecasting.base import ForecastingHorizon\n",
                "\n",
                "fh = ForecastingHorizon([1, 2, 3], is_relative=True)\n",
                "model.fit(y=y_train, fh=fh)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Then we can predict on `y_test` which is not included in `y_train`."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 38,
            "metadata": {},
            "outputs": [
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "GPU available: True (cuda), used: True\n",
                        "TPU available: False, using: 0 TPU cores\n",
                        "IPU available: False, using: 0 IPUs\n",
                        "HPU available: False, using: 0 HPUs\n",
                        "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n"
                    ]
                },
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>c0</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_90</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>3.747893</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>3.716210</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.680586</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_91</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>4.273325</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>4.335873</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>4.329363</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_92</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>3.879993</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>3.900126</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.889120</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_93</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>4.310719</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>4.048112</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.862309</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_94</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>3.713766</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>3.528116</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.399841</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_95</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>4.167168</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>4.198434</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>4.184916</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_96</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>3.765751</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>3.565860</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.430732</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_97</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>3.898326</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>3.843762</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.793458</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_98</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>3.939527</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>3.951651</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.939065</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_99</th>\n",
                            "      <th>2000-01-11</th>\n",
                            "      <td>3.916081</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-12</th>\n",
                            "      <td>3.825488</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-13</th>\n",
                            "      <td>3.755118</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                        c0\n",
                            "h0    time                \n",
                            "h0_90 2000-01-11  3.747893\n",
                            "      2000-01-12  3.716210\n",
                            "      2000-01-13  3.680586\n",
                            "h0_91 2000-01-11  4.273325\n",
                            "      2000-01-12  4.335873\n",
                            "      2000-01-13  4.329363\n",
                            "h0_92 2000-01-11  3.879993\n",
                            "      2000-01-12  3.900126\n",
                            "      2000-01-13  3.889120\n",
                            "h0_93 2000-01-11  4.310719\n",
                            "      2000-01-12  4.048112\n",
                            "      2000-01-13  3.862309\n",
                            "h0_94 2000-01-11  3.713766\n",
                            "      2000-01-12  3.528116\n",
                            "      2000-01-13  3.399841\n",
                            "h0_95 2000-01-11  4.167168\n",
                            "      2000-01-12  4.198434\n",
                            "      2000-01-13  4.184916\n",
                            "h0_96 2000-01-11  3.765751\n",
                            "      2000-01-12  3.565860\n",
                            "      2000-01-13  3.430732\n",
                            "h0_97 2000-01-11  3.898326\n",
                            "      2000-01-12  3.843762\n",
                            "      2000-01-13  3.793458\n",
                            "h0_98 2000-01-11  3.939527\n",
                            "      2000-01-12  3.951651\n",
                            "      2000-01-13  3.939065\n",
                            "h0_99 2000-01-11  3.916081\n",
                            "      2000-01-12  3.825488\n",
                            "      2000-01-13  3.755118"
                        ]
                    },
                    "execution_count": 38,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "y_pred = model.predict(y=y_test, fh=fh)\n",
                "y_pred"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`y_pred` have the same instance index as `y_test` which is `h0_90` to `h0_99`."
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "We can plot one series to see the result. As we are using random data and only train the model for a few epochs, we can not expect too much."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 39,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/plain": [
                            "(<Figure size 1600x400 with 1 Axes>, <Axes: ylabel='c0'>)"
                        ]
                    },
                    "execution_count": 39,
                    "metadata": {},
                    "output_type": "execute_result"
                },
                {
                    "data": {
                        "image/png": "iVBORw0KGgoAAAANSUhEUgAABR8AAAFfCAYAAADH1rujAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABphklEQVR4nO3dd3yV5f3/8fd1slgJIYwAAcIIhL0RIlOWuEet+FUrLkStVmvbb9VftbZ+q9XaYR21BbXUuuoArYupohAQGWEYwgwjQNgkQHau3x93EoisAEmuM17Px+N6nJtz7nPOO+RWks+5PtdlJFkBAAAAAAAAQDXzuQ4AAAAAAAAAIDhRfAQAAAAAAABQIyg+AgAAAAAAAKgRFB8BAAAAAAAA1AiKjwAAAAAAAABqBMVHAAAAAAAAADWC4iMAAAAAAACAGhHuOoALLVu2VG5urusYAAAAAAAAQECKjo7W9u3bT3teyBUfW7ZsqaysLNcxAAAAAAAAgICWkJBw2gJkyBUfy2c8JiQkMPsRAAAAAAAAOEPR0dHKysqqUm0t5IqP5XJzcyk+AgAAAAAAADWIDWcAAAAAAAAA1AiKjwAAAAAAAABqBMVHAAAAAAAAADUiZNd8BAAAAAAAgP+rV6+emjRpImOM6yghwVqrPXv26MiRI9XyehQfAQAAAAAA4HeMMbrllls0YsQI11FC0hdffKFXX31V1tpzeh2KjwAAAAAAAPA7t9xyi4YPH663335ba9asUXFxsetIISE8PFydO3fWtddeK0l65ZVXzu31qiMUAAAAAAAAUF3q16+vESNG6O2339bHH3/sOk7I2bBhgyRp/Pjxeuutt86pBZsNZwAAAAAAAOBXGjduLElas2aN4yShq/zvvkmTJuf0Osx8BBCYklKklOukuARpX5aU+pa0PtV1KgAAAABANSjfXIZWa3fK/+7PdaMfZj4CCDxJKTJXPCQ1SZQJj/Rur3jIK0gCAAAAAAC/QfERQOBJuU62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froo1q6dKnuueeeWkobxHZnym5PlwkLl7qPcZ0GgSYs4piW6/luswAIXUcOSAvekCbfJjvzOdk9W2Qi68n0u9ybCXn5Q1JCV9cpgTMT3UQa+iPv+Kt/eeufAgAABBDnxccXXnhBH3/8sebMmXPac1NSUjR79uxK982YMUMpKSknfU5kZKSio6MrDZzE8rLZjz0vZK0snJm2fbyW69w90vY1rtMACHXFhdLKWdLUe2TffVR20xIZ45PpmCJz3e+lG/4odR7u7RwM+LvRd8tE1pPN+u7oz2oAAAABxGmFafz48erbt68eeuihKp3fvHlzZWdnV7ovOztbzZs3P+lzHnroIeXk5FSMrKysc8oc1NbOl83LkYlpKrXv7zoNAgkt1wD81ebl0vu/kX31x7Jpn8kWFcg07yhzyc+8XbLPu0aq08B1SuDEOg+Xad9ftrhImvmc+DcWAAAEImfFx1atWunZZ5/VDTfcoIKCghp7nyeffFIxMTEVIyEhocbeK+CVFEmrymaWsvEMqio8Uko6zztml2sA/mrfVmn2i9LkW2W//rfsoX0y0Y1lht4k3fGqNOouqRE/I8CP1I2RRk70jhe+Je3jA3QAABCYnPUb9evXT/Hx8Vq6dOnRMOHhGjZsmO655x5FRUWptLS00nN27typ+PjKC8bHx8dr586dJ32fwsJCFRYWVm/4YLZihjTgaqltH29x/oPZp38OQlvbPl47WM5uacda12kA4NTycqVF/5G+fV82eajU7wqZZu2l3hdJvS/ydhJe8qG05dSb4AE17oKJMnVjZHdtkha/7zoNAADAWXNWfJwzZ466d+9e6b5XX31Va9as0VNPPXVc4VGSUlNTNWrUKD377LMV940ZM0apqak1njdkHNghm7lUpm1f2Z7jpK+muk4Ef0fLNYBAVFIsffe59N3nsq26S/2ukDoMkGk/QGo/QHZ3prRttdSqm9SopTfrLPUtaT0/c6AWtO8v02W4bGmJ125dWuI6EQAAwFlzVnw8dOiQVq9eXem+w4cPa+/evRX3T506VVlZWXr44YclSc8++6y+/PJLPfDAA/r444913XXXqX///rrjjjtqPX9QS/tUattX6j5aWvC69wsacCLhkVKHsp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AACoERQfAQAAAAAAANQIio8AAAAAAAAAagTFRwAAAAAAAAA1guIjAAAAAAAAgBoR7jqAK9HR0a4jAAAAAAAAAAHnTOpqIVd8LP/LycrKcpwEAAAAAAAACFzR0dHKzc095TlGkq2dOP6jZcuWp/2LCWTR0dHKyspSQkJCUH+dANc6QgnXO0IJ1ztCCdc7QgnXO0JJKFzv0dHR2r59+2nPC7mZj5Kq9BcTDHJzc4P2AgeOxbWOUML1jlDC9Y5QwvWOUML1jlASzNd7Vb8uNpwBAAAAAAAAUCMoPgIAAAAAAACoERQfg1BBQYEee+wxFRQUuI4C1CiudYQSrneEEq53hBKud4QSrneEEq73o0JywxkAAAAAAAAANY+ZjwAAAAAAAABqBMVHAAAAAAAAADWC4iMAAAAAAACAGkHxEQAAAAAAAECNoPgIAAAAAAAAoEZQfDwHDz74oL755hvl5OQoOztb06ZNU6dOnSqdExUVpeeff1579uxRbm6u3n33XTVr1qzSOa1bt9ZHH32kw4cPKzs7W08//bTCwsIqnTN8+HAtWbJE+fn5WrdunSZMmFCljL/5zW+0fft2HTlyRLNmzVJSUlKlxx9++GHNnz9fhw8f1v79+6v8tffo0UPz5s1TXl6etmzZol/84heVHu/ataveffddbdq0SdZa3XfffVV+bfgfrvWTX+tXXXWVFi9erP379+vQoUNatmyZbrzxxiq/PvwP1/vJr/cJEybIWltp5OXlVfn14X+43k9+vX/++efHXe/WWn300UdVfg/4F673k1/v4eHheuSRR7R+/Xrl5eVp+fLluvDCC6v8+vA/oXq9R0VF6dVXX9WKFStUVFSkadOmHXdO8+bN9frrrysjI0MlJSX685//XKXXhv/iej/59T548GB9/fXX2rNnj44cOaL09HTdf//9VXr96mYZZzc+/fRTO2HCBNu1a1fbs2dP+9FHH9nMzExbr169inNefPFFu3nzZnvBBRfYvn372gULFtivv/664nGfz2dXrFhhZ86caXv16mXHjRtnd+3aZX/3u99VnNO2bVt76NAh+8wzz9jOnTvbH//4x7aoqMiOHTv2lPn+93//1+7fv99efvnltkePHnb69Ol2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ojdtGlTbX+P3F8kgTpeeOEFu3//fjts2DAbHx9fMerUqVNxzosvvmgzMzPtiBEjbN++fe38+fPt/PnzKx4v3879s88+sz179rRjx4612dnZJ9zO/amnnrLJycn2rrvuqvJ27vv27bOXXXaZ7d69u502bdpx27m3bt3a9urVyz7yyCM2JyfH9urVy/bq1cvWr1//pK8bExNjd+zYYadOnWq7du1qr7322uO2ao+IiKh4raysLPv000/bXr162Q4dOjj/vjG41qvzWn/wwQft6NGjbbt27Wznzp3tAw88YAsLC+1tt93m/PvG4Hqv7uv9kUcesWPGjLHt2rWzffr0sW+88YY9cuSI7dKli/PvG4Prvbqv9/Ixb948++abbzr/XjHOfXC9n/x6P++88+xVV11l27VrZ4cMGWJnz55tN2zYYBs2bOj8+8bgej+T612S7dKli+3Vq5f94IMP7Ny5cyued+w55fctXrzY/vvf/7a9evXi55kAHlzvJ7/e7777bnvppZfapKQkm5SUZG+99VZ78OBB+/jjj9f298n9hRKo42QmTJhQcU5UVJR9/vnn7d69e+2hQ4fse++9Z+Pj4yu9Tps2bezHH39sDx8+bHft2mX/8Ic/2LCwsErnDB8+3C5dutTm5+fb9evXV3qPU43f/OY3dseOHTYvL8/OmjXLduzYsdLjr7766gm/huHDh5/ydXv06GHnzZtn8/Ly7NatW+3//u//Vno8MTHxhK/LbLDAHFzrJ7/WH3/8cbt27Vp75MgRu3fvXjt//nx77bXXOv+eMc5+cL2f/Hr/05/+ZDMzM21+fr7dsWOH/eijj2zv3r2df88YZz+43k9+vUtHZ0WMHj3a+feKce6D6/3k1/uwYcPs6tWrbV5ent29e7edOnWqbdGihfPvGePsRyhf75s2bTrh80739+NgJhijmgbX+8mv93vuuceuXLnSHjp0yB44cMAuWbLE3nnnndYYU6vfI1N2AAAAAAAAAADVit2uAQAAAAAAANQIio8AAAAAAAAAagTFRwAAAAAAAAA1guIjAAAAAAAAgBpB8REAAAAAAABAjaD4CAAAAAAAAKBGUHwEAAAAAAAAUCMoPgIAAAAAAACoERQfAQAAAAAAANQIio8AAAAAAAAAagTFRwAAAAAAAAA14v8D5NoS0F+jaaoAAAAASUVORK5CYII=",
                        "text/plain": [
                            "<Figure size 1600x400 with 1 Axes>"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "from sktime.utils.plotting import plot_series\n",
                "\n",
                "plot_series(\n",
                "    y_test.loc[(\"h0_99\")],\n",
                "    y_pred.loc[(\"h0_99\")],\n",
                "    labels=[\"y\", \"y_pred\"],\n",
                ")"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "#### Global Forecasting with exogeneous data"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "When we predict with exogeneous data, we need to pass both `X` and `y` to `predict`.\n",
                "\n",
                "`X` must contain all historical values and the time points to be predicted while `y` should only contain the historical values but not the time points to be predicted."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 40,
            "metadata": {},
            "outputs": [],
            "source": [
                "from sklearn.model_selection import train_test_split\n",
                "\n",
                "from sktime.utils._testing.hierarchical import _make_hierarchical\n",
                "\n",
                "data = _make_hierarchical(\n",
                "    hierarchy_levels=(100, 1), max_timepoints=10, min_timepoints=10, n_columns=2\n",
                ")\n",
                "data = data.droplevel(1)\n",
                "x = data[\"c0\"].to_frame()\n",
                "y = data[\"c1\"].to_frame()\n",
                "X_train, X_test, y_train, y_test = train_test_split(\n",
                "    x, y, test_size=0.1, train_size=0.9, shuffle=False\n",
                ")\n",
                "y_test = y_test.groupby(level=0).apply(lambda x: x.droplevel(0).iloc[:-3])"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`X_train` and `y_train` have the same time index from 2000-01-01 to 2000-01-10.\n",
                "\n",
                "However `y_test` is shorter than `X_test`. \n",
                "\n",
                "`X_test` has the time index from 2000-01-01 to 2000-01-10 but `y_test` only has the time index from 2000-01-01 to 2000-01-07. \n",
                "\n",
                "This is because we don't know the values from 2000-01-08 to 2000-01-10 of `y_test` which are going to be forecasted."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 41,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>c1</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_90</th>\n",
                            "      <th>2000-01-01</th>\n",
                            "      <td>4.697726</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-02</th>\n",
                            "      <td>4.376547</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-03</th>\n",
                            "      <td>4.419372</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-04</th>\n",
                            "      <td>6.045622</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-05</th>\n",
                            "      <td>4.986501</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>...</th>\n",
                            "      <th>...</th>\n",
                            "      <td>...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"5\" valign=\"top\">h0_99</th>\n",
                            "      <th>2000-01-03</th>\n",
                            "      <td>3.633788</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-04</th>\n",
                            "      <td>5.149747</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-05</th>\n",
                            "      <td>5.850804</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-06</th>\n",
                            "      <td>3.724629</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-07</th>\n",
                            "      <td>4.151905</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "<p>70 rows × 1 columns</p>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                        c1\n",
                            "h0    time                \n",
                            "h0_90 2000-01-01  4.697726\n",
                            "      2000-01-02  4.376547\n",
                            "      2000-01-03  4.419372\n",
                            "      2000-01-04  6.045622\n",
                            "      2000-01-05  4.986501\n",
                            "...                    ...\n",
                            "h0_99 2000-01-03  3.633788\n",
                            "      2000-01-04  5.149747\n",
                            "      2000-01-05  5.850804\n",
                            "      2000-01-06  3.724629\n",
                            "      2000-01-07  4.151905\n",
                            "\n",
                            "[70 rows x 1 columns]"
                        ]
                    },
                    "execution_count": 41,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "y_test"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "`y_test` is shorter than `X_test` as `y_test` only contains the historical values not the time points to be predicted."
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Let's initialize a global forecaster which can handle exogeneous data."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 42,
            "metadata": {},
            "outputs": [],
            "source": [
                "from sktime.forecasting.pytorchforecasting import PytorchForecastingTFT"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 43,
            "metadata": {},
            "outputs": [],
            "source": [
                "model = PytorchForecastingTFT(\n",
                "    trainer_params={\n",
                "        \"max_epochs\": 5,  # for quick test\n",
                "        \"limit_train_batches\": 10,  # for quick test\n",
                "    },\n",
                "    dataset_params={\n",
                "        \"max_encoder_length\": 3,\n",
                "    },\n",
                ")"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 44,
            "metadata": {},
            "outputs": [
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "GPU available: True (cuda), used: True\n",
                        "TPU available: False, using: 0 TPU cores\n",
                        "IPU available: False, using: 0 IPUs\n",
                        "HPU available: False, using: 0 HPUs\n",
                        "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n",
                        "\n",
                        "   | Name                               | Type                            | Params\n",
                        "----------------------------------------------------------------------------------------\n",
                        "0  | loss                               | QuantileLoss                    | 0     \n",
                        "1  | logging_metrics                    | ModuleList                      | 0     \n",
                        "2  | input_embeddings                   | MultiEmbedding                  | 0     \n",
                        "3  | prescalers                         | ModuleDict                      | 32    \n",
                        "4  | static_variable_selection          | VariableSelectionNetwork        | 0     \n",
                        "5  | encoder_variable_selection         | VariableSelectionNetwork        | 1.2 K \n",
                        "6  | decoder_variable_selection         | VariableSelectionNetwork        | 528   \n",
                        "7  | static_context_variable_selection  | GatedResidualNetwork            | 1.1 K \n",
                        "8  | static_context_initial_hidden_lstm | GatedResidualNetwork            | 1.1 K \n",
                        "9  | static_context_initial_cell_lstm   | GatedResidualNetwork            | 1.1 K \n",
                        "10 | static_context_enrichment          | GatedResidualNetwork            | 1.1 K \n",
                        "11 | lstm_encoder                       | LSTM                            | 2.2 K \n",
                        "12 | lstm_decoder                       | LSTM                            | 2.2 K \n",
                        "13 | post_lstm_gate_encoder             | GatedLinearUnit                 | 544   \n",
                        "14 | post_lstm_add_norm_encoder         | AddNorm                         | 32    \n",
                        "15 | static_enrichment                  | GatedResidualNetwork            | 1.4 K \n",
                        "16 | multihead_attn                     | InterpretableMultiHeadAttention | 676   \n",
                        "17 | post_attn_gate_norm                | GateAddNorm                     | 576   \n",
                        "18 | pos_wise_ff                        | GatedResidualNetwork            | 1.1 K \n",
                        "19 | pre_output_gate_norm               | GateAddNorm                     | 576   \n",
                        "20 | output_layer                       | Linear                          | 119   \n",
                        "----------------------------------------------------------------------------------------\n",
                        "15.5 K    Trainable params\n",
                        "0         Non-trainable params\n",
                        "15.5 K    Total params\n",
                        "0.062     Total estimated model params size (MB)\n"
                    ]
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "85fc739de79e4f1abb918568072cf596",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Sanity Checking: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "d5db58ca151c4acd9c00b9c79557d6a6",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Training: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "71faab78c5ed4cb4b3bbb123cc2c389d",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "d2f8a892df774f3ab3783592118b0eee",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "bc932ba78ffe4e8581594a670fe8f627",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "70ef956d44d24cde8b0c2b8151338c44",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "model_id": "4b97116993bf404eb528b3c070df74b6",
                            "version_major": 2,
                            "version_minor": 0
                        },
                        "text/plain": [
                            "Validation: |          | 0/? [00:00<?, ?it/s]"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                },
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "`Trainer.fit` stopped: `max_epochs=5` reached.\n"
                    ]
                },
                {
                    "data": {
                        "text/html": [
                            "<style>#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 {color: black;background-color: white;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 pre{padding: 0;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-toggleable {background-color: white;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-estimator:hover {background-color: #d4ebff;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-item {z-index: 1;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-parallel::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-parallel-item {display: flex;flex-direction: column;position: relative;background-color: white;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-parallel-item:only-child::after {width: 0;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;position: relative;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-label label {font-family: monospace;font-weight: bold;background-color: white;display: inline-block;line-height: 1.2em;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-label-container {position: relative;z-index: 2;text-align: center;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-2b1ca608-b851-4ce3-97db-22b6c7490069 div.sk-text-repr-fallback {display: none;}</style><div id='sk-2b1ca608-b851-4ce3-97db-22b6c7490069' class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>PytorchForecastingTFT(dataset_params={&#x27;max_encoder_length&#x27;: 3},\n",
                            "                      trainer_params={&#x27;limit_train_batches&#x27;: 10,\n",
                            "                                      &#x27;max_epochs&#x27;: 5})</pre><b>Please rerun this cell to show the HTML repr or trust the notebook.</b></div><div class=\"sk-container\" hidden><div class='sk-item'><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=UUID('a8fd5f47-313d-4275-a4e6-311a9e4903f1') type=\"checkbox\" checked><label for=UUID('a8fd5f47-313d-4275-a4e6-311a9e4903f1') class='sk-toggleable__label sk-toggleable__label-arrow'>PytorchForecastingTFT</label><div class=\"sk-toggleable__content\"><pre>PytorchForecastingTFT(dataset_params={&#x27;max_encoder_length&#x27;: 3},\n",
                            "                      trainer_params={&#x27;limit_train_batches&#x27;: 10,\n",
                            "                                      &#x27;max_epochs&#x27;: 5})</pre></div></div></div></div></div>"
                        ],
                        "text/plain": [
                            "PytorchForecastingTFT(dataset_params={'max_encoder_length': 3},\n",
                            "                      trainer_params={'limit_train_batches': 10,\n",
                            "                                      'max_epochs': 5})"
                        ]
                    },
                    "execution_count": 44,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "model.fit(y=y_train, X=X_train, fh=fh)"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "Now we can predict on `y_test` with `X_test`."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 45,
            "metadata": {},
            "outputs": [
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "GPU available: True (cuda), used: True\n",
                        "TPU available: False, using: 0 TPU cores\n",
                        "IPU available: False, using: 0 IPUs\n",
                        "HPU available: False, using: 0 HPUs\n",
                        "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n"
                    ]
                },
                {
                    "data": {
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th></th>\n",
                            "      <th>c1</th>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>h0</th>\n",
                            "      <th>time</th>\n",
                            "      <th></th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_90</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>5.293717</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.416963</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.225151</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_91</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>5.403152</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.357550</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.228848</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_92</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>4.887965</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.358321</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.270049</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_93</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>4.839972</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.394659</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.279878</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_94</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>5.108763</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.272538</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.389787</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_95</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>5.334348</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.442789</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.271264</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_96</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>5.372472</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.166903</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.351241</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_97</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>5.397213</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.419333</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.382102</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_98</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>4.978965</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.106180</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.135403</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th rowspan=\"3\" valign=\"top\">h0_99</th>\n",
                            "      <th>2000-01-08</th>\n",
                            "      <td>5.401626</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-09</th>\n",
                            "      <td>5.305851</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2000-01-10</th>\n",
                            "      <td>5.175489</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "</div>"
                        ],
                        "text/plain": [
                            "                        c1\n",
                            "h0    time                \n",
                            "h0_90 2000-01-08  5.293717\n",
                            "      2000-01-09  5.416963\n",
                            "      2000-01-10  5.225151\n",
                            "h0_91 2000-01-08  5.403152\n",
                            "      2000-01-09  5.357550\n",
                            "      2000-01-10  5.228848\n",
                            "h0_92 2000-01-08  4.887965\n",
                            "      2000-01-09  5.358321\n",
                            "      2000-01-10  5.270049\n",
                            "h0_93 2000-01-08  4.839972\n",
                            "      2000-01-09  5.394659\n",
                            "      2000-01-10  5.279878\n",
                            "h0_94 2000-01-08  5.108763\n",
                            "      2000-01-09  5.272538\n",
                            "      2000-01-10  5.389787\n",
                            "h0_95 2000-01-08  5.334348\n",
                            "      2000-01-09  5.442789\n",
                            "      2000-01-10  5.271264\n",
                            "h0_96 2000-01-08  5.372472\n",
                            "      2000-01-09  5.166903\n",
                            "      2000-01-10  5.351241\n",
                            "h0_97 2000-01-08  5.397213\n",
                            "      2000-01-09  5.419333\n",
                            "      2000-01-10  5.382102\n",
                            "h0_98 2000-01-08  4.978965\n",
                            "      2000-01-09  5.106180\n",
                            "      2000-01-10  5.135403\n",
                            "h0_99 2000-01-08  5.401626\n",
                            "      2000-01-09  5.305851\n",
                            "      2000-01-10  5.175489"
                        ]
                    },
                    "execution_count": 45,
                    "metadata": {},
                    "output_type": "execute_result"
                }
            ],
            "source": [
                "y_pred = model.predict(fh=fh, X=X_test, y=y_test)\n",
                "y_pred"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "We can plot one series to see the result. As we are using random data and only train the model for a few epochs, we can not expect too much."
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 46,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "text/plain": [
                            "(<Figure size 1600x400 with 1 Axes>, <Axes: ylabel='c1'>)"
                        ]
                    },
                    "execution_count": 46,
                    "metadata": {},
                    "output_type": "execute_result"
                },
                {
                    "data": {
                        "image/png": "iVBORw0KGgoAAAANSUhEUgAABR8AAAFfCAYAAADH1rujAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABlGklEQVR4nO3dd3yV9d3/8deVwQ4gIFsQBNlDRCVsBVTAfVtxU63W0aHVtlZ/rfa+e7e2Vq22attb6961RVtwggOZKlsEBBWQsHeAQEjy/f1xSZQKyEhynSSv5+NxHrm4znXOeScfICeffEcEBCRJkiRJkiSphKUlHUCSJEmSJElSxWTzUZIkSZIkSVKpsPkoSZIkSZIkqVTYfJQkSZIkSZJUKmw+SpIkSZIkSSoVNh8lSZIkSZIklQqbj5IkSZIkSZJKRUbSAZLQtGlTcnNzk44hSZIkSZIklUtZWVksX778G6+rdM3Hpk2bkpOTk3QMSZIkSZIkqVxr1qzZNzYgK13zcdeIx2bNmjn6UZIkSZIkSTpAWVlZ5OTk7FdvrdI1H3fJzc21+ShJkiRJkiSVIjeckSRJkiRJklQqbD5KkiRJkiRJKhU2HyVJkiRJkiSVikq75qMkSZIkSZJSX40aNWjQoAFRFCUdpVIIIbB27Vq2bdtWIs9n81GSJEmSJEkpJ4oiLrvsMgYOHJh0lErp7bff5pFHHiGEcEjPY/NRkiRJkiRJKeeyyy5jwIABPPfcc8yfP5+CgoKkI1UKGRkZtG/fnvPOOw+Ahx9++NCeryRCSZIkSZIkSSWlZs2aDBw4kOeee44xY8YkHafS+eSTTwAYMWIEzz777CFNw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nuve0ZGBr/4xS9YtGgReXl5zJw5k1NOOWW/nz9VVdaaV61alUceeYTZs2ezc+fOvb4vP9jMJS14O7jbK6+8EkaOHBk6duwYunbtGkaPHh0WL14catSoUXzNAw88EJYsWRJOPPHE0KNHjzBp0qQwYcKE4vvT0tLC7Nmzw+uvvx66desWTj311LB69erw61//uviaI488MmzZsiXceeedoX379uF73/te2LlzZzj55JP3me+nP/1p2LBhQzjjjDNCly5dwosvvhg++eSTULVq1eJrfvnLX4brr78+3HnnnWHDhg379XlnZWWFFStWhCeeeCJ07NgxjBgxImzdujVceeWVxdf07Nkz3HHHHWHEiBFh+fLl4brrrku8Xta8dGv+5JNPhmuuuSZ069YttGvXLjz88MNhw4YNoWnTponXzZqXTs0HDBgQzjrrrNC+ffvQunXr8MMf/nC/Mqf6zZrvvea7bi1btgyff/55eOedd8KoUaMSr5l1L926jxw5MmzcuDE0atSo+NawYcPEa2bNS6/mmZmZ4b333gujR48OvXv3Di1btgz9+/cPXbt2Tbxu1rx0an7YYYft9m+8Y8eOYefOnWHkyJGJ182al07NL7jggpCXlxcuuOCC0LJlyzBkyJCQk5MT7rrrrsTrZt1Lr+6//e1vw7Jly8LQoUNDq1atwtVXXx22bdsWunfvnnjdrPmB17xGjRrhgQceCFdccUV45ZVX9vi+/GAzl8It+b8oFeXWoEGDEEII/fr1C0CoXbt22LFjR/iv//qv4mvatWsXQgjhhBNOCEA49dRTQ0FBwW5v4q+66qqwcePGkJmZGSD+D2LOnDm7vdYzzzwTXnnllX3mWb58ebjxxhuL/1y7du2Ql5cXRowY8bVrR44cud9/wa+++uqwbt264nxAuP3228O8efP2eP1nn31WYZqP1nz/ag7xf96bNm0Kl1xySeJ1suZlU3MgTJs2LfzP//xP4nWy5qVX87S0tDBhwoRw+eWXh0ceeaTCNB+t+97rfiDPV55v1nzebp/DokWLQkZGRuJ1sebJfE+/7rrrwqZNm3b7wb0i3Kz5lzX/05/+FMaOHbvb4+68887w7rvvJl4n6156dc/JyQnXXnvtbo974YUXwhNPPJF4naz5gdf8q7e9vS8/2MwlfXPadQmqU6cOAOvXrwfg2GOPpUqVKowdO7b4mgULFrBkyRKys7MByM7OZs6cOaxevbr4mtdee406derQqVOn4mu++hy7rtn1HHvSqlUrmjRpstvjNm/ezNSpU/f5uP2RnZ3N+PHj2blz52552rdvT926dQ/pucsba773mteoUYPMzMzir01FYc33XvOTTjqJdu3aMX78+EN67VRjzXev+a233srq1at5+OGHD+n1Up11373utWrVYvHixSxdupQXX3yRjh07HtLrpiJr/mXNzzjjDCZPnsz999/PypUrmTNnDjfffDNpaRXrRwdrvvfv6d/5znd49tln2bZt2yG9dqqx5l/WfNKkSRx77LHFyyS1atWKYcOG8fLLLx/Sa6ci6/5l3atWrcr27dt3e1xeXh59+/Y9pNdONZWl5vvjYDKXhor1DiJBURRxzz33MGHCBObOnQtA48aN2bFjB5s2bdrt2lWrVtG4cePia1atWvW1+3fdt69r6tSpQ7Vq1faYZ9dj9/S4XfcdrP3JXBlY833X/He/+x3Lly//2n905Zk1/3rNa9euTW5uLvn5+YwZM4Yf/OAH1pyKW/M+ffrwne98hyuvvPKQXivVWffdMy9YsIDLL7+cM888k4svvpi0tDQmTZpEs2bNDum1U4k13z1z69atOffcc0lPT2fYsGH86le/4sYbb+TnP//5Ib12KrHme38fd9xxx9GlSxceeuihQ3rdVGPNd8/8zDPPcOuttzJhwgTy8/P59NNPefvtt7n99tsP6bVTjXXfPfNrr73GDTfcQJs2bYiiiMGDB3POOefQpEmTQ3rtVFKZar4/DiZzabD5WELuv/9+OnfuzPnnn1/mr33hhReSm5tbfCvJ31p8+OGHxc9bEX8Ldiis+d7ddNNNnH/++Zx99tns2LGjxLIlzZp/XW5uLt27d+e4447j//2//8fdd9/NgAEDSixb0qz5l2rVqsUTTzzBlVdeybp160osSyqy7rubMmUKTzzxBLNmzWL8+PGcc845rFmzhquuuqrEsiXNmu8uLS2N1atX893vfpfp06fz/PPP8+tf/5qrr766xLIlzZrv3Xe+8x1mz57N+++/X2K5UoE1392AAQO45ZZbuPbaa+nRowdnn302w4cPr1C/ZADr/p+uu+46Fi5cyPz588nPz+e+++7jkUceoaioqMSyJc2ap6aMpANUBH/605847bTT6N+/Pzk5OcXnV65cSdWqValTp85uHfZGjRqxcuXK4muOP/743Z6vUaNGxfft+rjr3Fev2bRpE9u3b+df//oXU6dOLb4vJyen+DcXX32tXX+eOXPmfn9uw4YNIzMzE6B4Z8u95flq5orOmu+95jfeeCM/+9nPGDx4MHPmzNnv10111nzPNQ8h8MknnwAwa9YsOnTowM0338w777yz36+fqqz57pmPOuooWrVqxb///e/i+3dNwdy5cyft2rXj008/3e8Mqcq6f/P39IKCAmbMmPG1XRrLK2v+9cwrVqxg586du/0wOm/ePJo0aUJmZuZuU/rKI2u+93/nNWrU4Pzzz+fWW2/d79csD6z51zP/6le/4oknnuBvf/sbEDc2atasyf/93//x61//mhDCfmdIVdb965nXrl3L2WefTdWqValfvz7Lly/nt7/9bYV4DweVr+b745syl6XEFwMtz7c//elPYdmyZaFNmzZfu2/XoqbnnHNO8bmjjz56j4uaHn744cXXXHnllWHjxo2hSpUqgS8WCJ09e/Zuz/3UU0/t16KmN9xwQ/Gfs7KySnQh268uQv7rX/+60mw4Y833XvOf/OQnYePGjcWfa0W5WfO91/w/b3/729/CW2+9lXjNrHnJ17xq1aqhU6dOu91GjRoVxo4dGzp16rTb4ubl9Wbdv173Pd3S0tLCvHnzKsSOqNZ8zzX/9a9/HT777LMQRVHxuR/+8IchJycn8ZpZ89Kp+VefNy8vL9SrVy/xWlnz0q35Bx98EH7729/u9rjzzz8/bN26NaSlpSVeN+teOnX/z1tGRkZYuHDhbjs6l9dbZaz5V2/72nDmYDKXwi35vyTl9Xb//feHDRs2hP79+4dGjRoV36pVq1Z8zQMPPBAWL14cBg4cGHr06BEmTpwYJk6cWHz/ru3cX3311dC1a9dw8sknh1WrVu1xO/ff/e53oV27duGaa67Z7+3c169fH04//fTQuXPnMGrUqK9t537EEUeEbt26hV/84hdh8+bNoVu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oV/x/+wNzS970cHAAAAABJRU5ErkJggg==",
                        "text/plain": [
                            "<Figure size 1600x400 with 1 Axes>"
                        ]
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": [
                "plot_series(\n",
                "    y_test.loc[(\"h0_99\")],\n",
                "    y_pred.loc[(\"h0_99\")],\n",
                "    labels=[\"y\", \"y_pred\"],\n",
                ")"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "## Building your own hierarchical or global forecaster\n",
                "\n",
                "Getting started:\n",
                "\n",
                "* follow the [\"implementing estimator\" developer guide](https://www.sktime.net/en/stable/developer_guide/add_estimators.html)\n",
                "* use the advanced [forecasting extension template](https://github.com/sktime/sktime/blob/main/extension_templates/forecasting.py)\n",
                "\n",
                "Extension template = python \"fill-in\" template with to-do blocks that allow you to implement your own, sktime-compatible forecasting algorithm.\n",
                "\n",
                "Check estimators using `check_estimator`\n",
                "\n",
                "For hierarchical forecasting:\n",
                "\n",
                "* ensure to pick supported mtypes for panel and hierarchical data\n",
                "* recommended: `y_inner_mtype = [\"pd.DataFrame\", \"pd-multiindex\", \"pd_multiindex_hier\"]`, same for `X_inner_mtype`\n",
                "    * this ensures the inputs `y`, `X` seen in `_fit`, `_predict` are `pd.DataFrame`, with 1, 2, 3 or more row levels\n",
                "* you can implement vectorization over rows if efficient implementation is available\n",
                "    * but: automated vectorization already loops over row index sets, don't implement that if that's what \"hierarchical\" is\n",
                "    * to ensure automated vectorization, do *not* include Hierarchical or Panel mtypes in `y_inner_mtype`, `X_inner_mtype`\n",
                "* think carefully whether your estimator is a forecaster, or can be decomposed in a transformer\n",
                "    * \"do X and then apply forecaster already in sktime\" is a strong hint that you actually want to implement a transformer\n"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "---\n",
                "\n",
                "### Credits\n",
                "\n",
                "notebook creation: danbartl, fkiraly\n",
                "\n",
                "hierarchical forecasting framework: ciaran-g, fkiraly\\\n",
                "reduction compatibility with hierarchical forecasting: danbartl\\\n",
                "window summarizer, reduction with transform-from-y: danbartl\\\n",
                "aggregation and reconciliation: ciaran-g\n",
                "global forecast: Xinyu Wu"
            ]
        }
    ],
    "metadata": {
        "kernelspec": {
            "display_name": "sktime-3.11",
            "language": "python",
            "name": "python3"
        },
        "language_info": {
            "codemirror_mode": {
                "name": "ipython",
                "version": 3
            },
            "file_extension": ".py",
            "mimetype": "text/x-python",
            "name": "python",
            "nbconvert_exporter": "python",
            "pygments_lexer": "ipython3",
            "version": "3.11.11"
        }
    },
    "nbformat": 4,
    "nbformat_minor": 4
}
